home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / Goodies Disk / EnterAct ƒ / EnterAct 1.4 Manual(no PICTs) next >
Encoding:
Text File  |  1991-09-16  |  147.8 KB  |  2,489 lines  |  [TEXT/KEEN]

  1. ************************ENTERACT USER’s MANUAL**********************
  2. Copyright © 1991 by Dynabyte. Portions Copyright © 1987 by Symantec Corporation.
  3. EnterAct 2, by Ken Earle. All rights reserved.  
  4.  
  5. NOT FOR USE ON NETWORKS
  6. -----------------------------------------------------------------
  7. This manual is actually for version 1.4 of EnterAct, the only omission being that version
  8. 2 comes with Drag_on Modules (separate CODE resource commands), which are not included
  9. with the demo version of EnterAct. The demo version of EnterAct has restricted file-saving
  10. capabilities, and you should use it for reviewing existing code rather than creating new code.
  11. The real version of Enteract 2 comes with a powerful Macintosh version of AWK, including the
  12. full source code—you can easily adapt your application to call it if you like. And you also get
  13. a printed manual, and a 60-day money back guarantee—so after a little dabbling here,
  14. try the real thing!
  15. -----------------------------------------------------------------
  16. System 6 or 7 required. Mac II speed (that is, a 68000 running at 16 mHz) is
  17. recommended if your project contains more than about 500K of text in source and
  18. header files combined. A hard disk is a practical necessity. A large screen (larger than
  19. 512 by 342) will allow you to take better advantage of EnterAct’s main innovation,
  20. the ability to retrieve definitions or prototypes from your project to separate “Lookup”
  21. windows—these are “self–placing” windows, and management of these windows is entirely
  22. reduced to the initial press of the <Enter> key that calls them up, provided only that you leave
  23. a bit of your screen free for them to find a home.
  24.  
  25. EnterAct is intended for creating, maintaining, and reviewing THINK C™ code. There are no
  26. known incompatibilities with MPW C™, but testing there has not been extensive, so the only
  27. guarantee there is that if you report a problem with MPW C a fix will be concocted and sent
  28. to you as soon as possible.
  29.  
  30. PLEASE NOTE if you use markers they will be maintained properly only by programs that
  31. implement MPW–compatible markers. In particular, if you edit a marked file with
  32. THINK C version 4 the marks will be thrown off. See the discussion at the end of
  33. “Markers and Automark” for a relatively painless workaround.
  34.  
  35. This document contains nearly the entire text of the printed manual, but lacks much of the
  36. typesetting of the printed version, and all of the illustrations, alas.
  37.  
  38. The benefits of having it on disk are that you can use Find on the table of contents
  39. and elsewhere to jump to topics of interest, and that this document is marked with chapter
  40. headings (albeit in alphabetical order)—hold down the <Command> key and click in the title
  41. bar to view the marks menu for this file.  Aside from that, it really reads better on paper.
  42.  
  43. Tech support/order information: 1-416-595-9440.
  44. For the licence, please see the printed version.
  45.  
  46. CONTENTS 
  47.                 (the page numbers are a bit off...)
  48.  
  49. Introduction        1
  50. Getting started        2
  51. Some definitions        3
  52. <Enter> and <Option>        7
  53. Whirlwind tour        9
  54. Not everything goes        21
  55. Projects        25
  56.     Introduction        25
  57.     What a project must contain    25
  58.     Creating a project        25
  59.     Three panes—.c, .h, plain text    26
  60.     Add Files—the old–fashioned way    26
  61.     Add All Files In Folder—the fast way    26
  62.     Add Mac Headers        27
  63.     Add Standard C Headers    28
  64.     Remove File        28
  65.     Custom file extensions    28
  66.     Distinguishing ".h" from <.h>    29
  67.     Copy and Search in the project window    29
  68.     Tips        30
  69. Dictionaries        31
  70.     Introduction        31
  71.     What's in a dictionary    31
  72.     Building your dictionary    32
  73.     Keeping it up to date        33
  74.     How long will it take?        33
  75.     Show Dictionary        34
  76.     If there’s a problem        34
  77. Lookup        37
  78.     Introduction        37
  79.     Click, press <Enter>        37
  80.     Press <Enter> again to see more entries    38
  81.     Your spelling        39
  82.     Hints for speedup        40
  83.     Number of lookup windows    41
  84.     Number of entries per lookup    42
  85.     Keeping lookups around    42
  86.     AutoLook        42
  87.     Paste Selection Behind    43
  88.     Editing an entry is temporary    44
  89.     If there’s a problem        44
  90. Browsing        45
  91.     The Browse command    45
  92.     Browsing classes without the browser    46
  93.     Browsing methods without the browser    46
  94. Editing        49
  95.     Introduction        49
  96.     The usual stuff        49
  97.     Undo        49
  98.     Typing, Cut, Copy, Clear    50
  99.     Paste preserves indentation    50
  100.     Selections: front, next–to–front    51
  101.     Paste Selection Behind    51
  102.     Font, font size, tabs        52
  103.     Shift Left / Right        53
  104.     Reformat Selection        54
  105.     Arrow keys for moving around    55
  106.     Go to        55
  107.     If there’s a problem        56
  108. Balance        57
  109.     Checks everything        57
  110.     Shows the error location    58
  111.     Balancing a file        58
  112.     Balancing a specific delimiter    59
  113.     Nested and bad comments    59
  114.     Starting in the  middle    61
  115.     Diagnosing a problem    62
  116.     The asm problem        63
  117. Search        65
  118.     Introduction        65
  119.     Find is modeless        65
  120.     Find options        66
  121.     <Tab> and <Return>        67
  122.     Find Again        67
  123.     Enter Selection        67
  124.     Recent finds are remembered    67
  125.     Replace        67
  126.     Replace and Find Again    68
  127.     Replace All        68
  128.     Multi-file Searches        68
  129.     Markers and Automark    69
  130. Documents  and windows    71
  131.     New, Open, Close        71
  132.     Save, Save As, Revert    71
  133.     Saving window locations    71
  134.     …without being pestered    72
  135.     Newly opened windows can be long or short    72
  136.     <Option>Zoom zooms just the length    73
  137.     Number of windows at one time    73
  138.     The Windows menu        73
  139.     The display box        74
  140.     Printing        75
  141. Options, under the Edit menu    77
  142.     Introduction        77
  143.     Number of lookup windows    77
  144.     Number of entries per lookup window    77
  145.     Remembering window locations    78
  146.     Long or short windows    78
  147.     Reformat Selection options    78
  148.     Detect nested comments    78
  149. Switching to other applications    79
  150.     Under the Finder        79
  151.     Under MultiFinder        79
  152.     Check the disk for changes    80
  153. Lookup tips        81
  154.     Looking up your notes    81
  155.     When in doubt        82
  156. Seeing where a term is defined    83
  157.     <Option>double–click    83
  158.     Find Definition        83
  159.     If there are multiple definitions    83
  160. Some thoughts on using EnterAct    85
  161.     Projects are cheap        85
  162.     Learning from or reviewing code    86
  163.     If lookup is too slow        86
  164.     Balance your files        86
  165.     If it moves, document it    87
  166. If there's a problem        89
  167.     Out of memory        89
  168.     Missing dictionary entries    89
  169.     Dictionary build problems    90
  170.     Lookup problems        94
  171.     Balance problems        95
  172.     
  173. ----------------------------------------------------------
  174. Introduction
  175. ----------------------------------------------------------
  176. Feeling slightly disoriented? That’s just the anesthetic wearing off. You now have several 
  177. megabytes of fast memory installed in your head, preloaded with details about everything of 
  178. interest in all of your C projects. To access your new memory, click just to the right of any 
  179. function, struct, define, etc that you’d like to see a definition for, and press <Enter>.
  180.  
  181. Welcome to EnterAct. If you’re already travelling at light speed, prepare for warp drive. If 
  182. you’re learning C, you’ll find that the ability to  look up anything of potential interest gives you 
  183. more than total recall—you now have an on–line personal tutor. 
  184.  
  185. This manual is not as impersonal as most. My name is Ken Earle, I’m responsible to you for 
  186. EnterAct’s performance, and if you have any problems using EnterAct that this manual doesn’t 
  187. answer please see the “Tech support” section at the end of this manual for my phone number and 
  188. hours. If you’ve done some programming in C on the Mac, you’ll find that EnterAct is mostly 
  189. familiar territory. EnterAct is intended to complement THINK C, which you will need for compiling 
  190. and testing your code. For creating, maintaining, learning from, and documenting code—read on.
  191.  
  192.     60 second warmup
  193. EnterAct uses a project window to keep track of your files, as does THINK C for example. 
  194. However, the main purpose of an EnterAct project is to allow you to build a dictionary of all 
  195. terms in your project, for rapid lookup. There are three panes in an EnterAct project window, 
  196. containing your .c, .h, and plain text files from left to right respectively. The easiest way to add 
  197. files to your project is to use the “Add All In Folder...” command. To build a dictionary, select 
  198. “Update Dictionary”. Unless there are major errors in your source code, this will zip along at 
  199. 2-3 files per second. Double–click on any file name in the project window to view a file. To look up 
  200. a term, select an insertion point just to the right of the term (or of course type it in) and press 
  201. <Enter>. Activating the “AutoLook” window provides constant lookup as you work.
  202.  
  203. What next? After “Getting started”, arm yourself with “Some definitions” and then take the 
  204. tour.  Browse through the rest of the manual, experiment a bit, reassess your ability to handle 
  205. complexity, put your new memory to work. And remember, take a break every hour!
  206.     
  207. ----------------------------------------------------------
  208. Getting started
  209. ----------------------------------------------------------
  210.  
  211.     Installation
  212. Install EnterAct in the same folder where you keep THINK C, at the same level. This will allow EnterAct
  213. to distinguish between your ".h" and your <.h> files, among other things. If you don’t have a set of
  214. prototypes for toolbox calls, and would like one, copy the “MacProto's.h” file to your “Mac
  215. #includes” folder. There is a copy of this manual on the disk also (illustrated, but lacking the
  216. typesetting). It’s rather huge, the illustrations will show only if you open it with EnterAct, and it’s
  217. definitely optional.
  218.  
  219.     What to do first
  220. If you don’t feel comfortable using your Macintosh yet, please take an hour or so to play with some
  221. other program before continuing. 
  222.  
  223. If there’s a “Read me” file on the disk, it will describe minor changes not listed in this manual. 
  224.  
  225. The Whirlwind tour will introduce you to the most important things.
  226. After a bit of pushing the <Enter> key and and playing with your new memory, I’d recommend you
  227. explore the Paste Selection Behind , Balance, and Automark commands, and the lookup options available
  228. to you in the Options dialog. EnterAct can be used as a decent browser of classes and methods, as
  229. described in “Browsing”. If you use MultiFinder, there are some important things about EnterAct you
  230. should know first, discussed in the “Switching to other applications” chapter.
  231.  
  232.     What to memorize
  233. The uses of the <Enter> and <Option> keys (there aren’t that many). They’re listed a couple of 
  234. pages ahead.
  235.  
  236.     What to watch out for
  237. If you’re a multi–platform developer, please read the “Not everything goes” section on 
  238. “All–or–nothing macro’s”.
  239.  
  240.     What to do eventually
  241. Read the manual, or at least browse through it. The table of contents serves as an index of the 
  242. important things, and there’s a menu reference at both ends of this manual. The “If there’s a 
  243. problem” sections are primarily there to be consulted when you have a problem, and are not 
  244. required reading.
  245.  
  246. Several of EnterAct’s features have been added at the request of users. If you’d like to see 
  247. anything added to EnterAct, please send me a note about it, the more details the better. No ask, no 
  248. get!
  249.     
  250. ----------------------------------------------------------
  251. Some definitions
  252. ----------------------------------------------------------
  253.  
  254. Bold face in the text is used only for menu commands. Menu     commands are sometimes used in 
  255. this manual as verbs, for example “when you Balance a comment...”. Key–equivalents for menu 
  256. commands are shown at the end of this manual.
  257.  
  258. Insertion point: the flashing “|”     cursor which marks your place in a text window when 
  259. no characters are selected. 
  260.  
  261. Range of characters selected:     white text on a black background in the front window, seen for 
  262. example when you drag over some text. In the next–to–front window, the selection range is shown 
  263. outlined in a black box rather than white on black (the next– to–front window is affected by Paste 
  264. Selection Behind, and by some Search commands when the Find dialog is in front).
  265.  
  266. Specific keys are placed in <>, eg <Enter>, <Option>, <Return>.
  267.  
  268. C code is shown in Courier 10.
  269.  
  270. Dictionary: the collection of terms and definitions for your project.
  271.  
  272. Term: anything defined or mentioned outside of a function, struct,     or union body.
  273.  
  274. Definition or Entry: for functions and methods, the prototype or     equivalent is shown. 
  275. For everything else (struct, #define, variable, etc), the full statement in which the term was 
  276. mentioned or defined is shown.
  277.  
  278. Lookup window: a special kind of text window used to show     dictionary entries. The title 
  279. always begins with “••” or “¶¶”. Often several entries are “stacked” in one lookup window; to 
  280. cycle through them, press <Enter> with a range of characters selected.
  281.  
  282. Look up a term: to look up a term, select an insertion point just to     the right of it and press 
  283. <Enter>. Up pops a lookup window.
  284.  
  285. Project: a three–pane window containing any group of source,     header, plain text, and PICT 
  286. documents. Selecting Update Dictionary builds a dictionary for all source and header files. 
  287. Double–clicking on a file shown in the project window will both open the file and send the project 
  288. window behind all other windows. It can be brought to the front again with the Windows menu, or 
  289. <Command><zero> if it’s hidden.
  290.  
  291. Paste Selection Behind: will Copy the selection in the front     window, switch to the next 
  292. window, and Paste over what is selected there. The selection in the next–to–front window will be 
  293. shown by a two–pixel wide black border.
  294.  
  295. Paired delimiters:
  296.         () round brackets, or parentheses
  297.         [] square brackets
  298.         {} braces, or curly braces
  299.         /* */ comment start and end, together a comment
  300.         " " double quotes (continued across lines with “\”)
  301.         ' ' single quotes, or ticks.
  302.  
  303. Balance: checks all paired delimiters, and detects nested or improperly–formed comments. If 
  304. you have an insertion point at the very beginning of the file, Balance will check the entire file. If 
  305. there’s an imbalance, you’ll see where it is.
  306.  
  307. Reformat Selection: evens out the line lengths in a range of selected     text, with maximum 
  308. line length and ragged right versus full justification as specified in the Options dialog. Intended for 
  309. use with comments or plain text, rather than code.
  310.  
  311. Find Definition: given a selected dictionary term, opens the file     where the term is 
  312. defined and scrolls to the first instance of the term in the file. The equivalent of 
  313. <Option>double–click, but in addition works with full method names, which contain colons.
  314.     
  315. ----------------------------------------------------------
  316. <Enter> and <Option>
  317. ----------------------------------------------------------
  318.  
  319.     <Enter>
  320. To look up the definition of a term, select an insertion point just to the right of it, or type the 
  321. term, and press <Enter>.
  322.   
  323. Lookup windows can often show more than one entry. To view the next entry, press <Enter> with 
  324. a range of characters selected. A range of characters is selected for you automatically when an 
  325. entry is first shown, allowing you to cycle through entries by repeatedly pressing <Enter>. The 
  326. number of the current entry you are viewing, and the total number of entries available, are shown 
  327. in the display box at the bottom of the lookup window, eg “1/4”, “3/7”.
  328.  
  329. To view the previous rather than next entry in a lookup window, hold down the <Option> key while 
  330. pressing <Enter>.
  331.  
  332. Looking up a definition for a term in a lookup window is the same as for any other text 
  333. window—select an insertion point just to the right of it, or type the term, and press <Enter>.
  334. Pressing the <Enter> key when your selection range or insertion point is not visible will just 
  335. scroll one end or the other of it into view.
  336.  
  337.     <Option>
  338. Holding down the <Option> key while double–clicking on a term will open the file where the term is 
  339. defined, and will usually scroll to the definition. This doesn’t work with full method names which 
  340. contain colons; for these, select the entire name on both sides of the two colons and use the Find 
  341. Definition command, which does the equivalent of <Option> double–click on anything you select. 
  342. Although your spelling must be correct in order for this to work, you can always look the term up 
  343. to find the correct spelling, and then <Option> double–click on the name shown in the lookup 
  344. window.
  345.  
  346. To modify the files selected for a multi–file search, hold down the <Option> key and drag over 
  347. files directly in the project window. You can also use the <Command> key for this. A bullet • 
  348. appears in the project window to the left of each file included in the search.
  349.  
  350. EnterAct will automatically scroll your text windows left and right as well as up and down. The 
  351. quickest way to return to viewing the left margin is to press <Option><left arrow>, which will 
  352. also move your insertion point to the left margin.
  353.     
  354. ----------------------------------------------------------
  355. Whirlwind tour
  356. ----------------------------------------------------------
  357.  
  358.     Hum along
  359. This little tour is more a suggestion of the order in which you should try 
  360. things than a set of specific examples. Think of some C files you’d like 
  361. to try EnterAct on, and fire up your Mac.
  362.  
  363.     Installation
  364. Copy EnterAct to the same folder where you have THINK C, at the same 
  365. level.
  366.  
  367.     Create a project
  368. Double–click on the EnterAct icon to start. You will see a dialog asking 
  369. if you want to open an existing project—cancel it. Another dialog will 
  370. appear, asking you to supply a name for a new project. Type in a name 
  371. (such as “test.e”), select a folder in which to save your new project, and 
  372. click the Save button. A three–pane project window will appear.
  373.  
  374.     Add some files
  375. You can add files to your project one at a time with the Add Files 
  376. command—but try the Add All In Folder command instead: it works exactly 
  377. the same as the Add Files command, but when you select one file and click 
  378. the Add button all other text files in the folder will be added to your 
  379. project as well. However, files contained in sub–folders are not added 
  380. automatically. PICT files can only be added one at a time, with the Add 
  381. Files command.
  382.   
  383. There is no need to ever select one of the three window panes when adding 
  384. files. The left pane is for your source files (.c), the middle for all 
  385. header files (.h), and the right pane is for all other text files (and 
  386. PICT’s). EnterAct selects the correct pane for each file automatically.
  387.  For this tour, it’s probably best to just add code files that you know 
  388. are compilable, saving your not–quite–ready–for–prime–time files for your 
  389. first real project after this one when you’ve seen the basics. The files 
  390. you add don’t have to add up to a THINK C project, no specific header 
  391. files are required, and no non–text files such as libraries need to be 
  392. added.
  393.  
  394. For this first example, you might want to select Add Mac Headers instead 
  395. of Add All In Folder. This will give you a perfectly adequate project 
  396. consisting of the standard “Mac #includes” header files, Quickdraw.h etc.
  397.  
  398.     Build a dictionary
  399. Your dictionary will contain all terms in your .c and .h files that are 
  400. defined or mentioned outside of a function, struct, or union body. To 
  401. build, it, select Update Dictionary from the Project menu, and sit back 
  402. for a few seconds—this shouldn’t take long, typically 1/2 second per file 
  403. on a Mac II. If a major bug does interrupt the dictionary build, you’ll 
  404. see a message telling you what’s up. You can either fix the bug and 
  405. reselect Update Dictionary, or, with the offending file selected in the 
  406. project window, select Remove File followed by Update Dictionary to go on 
  407. with this tour immediately. 
  408.  
  409. Two special cases: if the error is "Unbalanced comment", due to a second comment
  410. start within a comment, you can use the Options command and uncheck the “Detect
  411. nested comment starts” option to get around this; and if the problem seems to be
  412. due to a macro, see the “All–or–nothing macro’s” section in the “Not everything
  413. goes” chapter for ways to get around this one. Entering the macro name in the
  414. "Macro's to skip..." dialog, as explained there, will usually do the job.
  415.  
  416. EnterAct needs about 300K of memory minimum, but your entire dictionary is 
  417. also kept in memory and this uses roughly one–half the total size of all 
  418. .h and .c files that you add to the project. If in doubt, use “Get Info” 
  419. on your source and header folders while in the Finder to determine the 
  420. total size of all your source and header files—then divide by two and add 
  421. 300K to see how much memory you’ll need.
  422.  
  423.     Start looking things up
  424. Open any .c or .h file by double–clicking on it in the left or middle 
  425. scrollable project window panes. You can look up any function, method, 
  426. struct class union or enum tag, enum constant, #define, typedef, or 
  427. variable (including low–memory and statics) that is defined or mentioned 
  428. anywhere in your .c or .h project files outside of a function, struct, or 
  429. union body. In other words, just about everything of interest except local 
  430. variables or any other “thing” which is meant to be used only within a 
  431. single specific function.
  432.  
  433. Find a term you’d like to look up, click just to the right of it (no text 
  434. selected, just a flashing insertion “I-beam” cursor) and press the <Enter> 
  435. key. Or type in the name of a term and press <Enter>. A dictionary entry 
  436. for the term will appear in a new small text window, called a “lookup” 
  437. window. Lookup windows are mostly like text windows, the key differences 
  438. being that they cannot be directly saved (Copy and Paste to a real text 
  439. window to do that), and they usually can show you other dictionary 
  440. entries. Only one is shown at a time.
  441.  
  442.     Lookup windows
  443. In the small display box along the bottom of the lookup window you will 
  444. see: the name of the file from which the entry was taken; the kind of term 
  445. it is (a one–letter abbreviation, for example “v” for variable, “(” for a 
  446. function, “s” for a struct); and two numbers—the current entry you are 
  447. viewing, followed by the total number of entries currently stored in the 
  448. lookup window. 
  449.  
  450. The title of the lookup window will be the term you wanted looked up, 
  451. preceded by two bullets, eg “••EventDetails”. The two bullets are a sign 
  452. that the window is a lookup window, not a regular document window.
  453.  
  454.     The AutoLook window
  455. Now is a good time to activate the AutoLook window, by selecting AutoLook from the “EnterAct”
  456. menu. It explains itself.
  457.  
  458.     Keeping the lookup around
  459. You can adjust the maximum number of lookup windows you wish to have 
  460. on–screen at one time, with the Options command: when this limit is 
  461. reached and you press <Enter> to see another lookup, one of the lookup 
  462. windows that is currently on–screen will quietly go away to make room for 
  463. the new one. To prevent this happening to a lookup window that you’d like 
  464. to keep around, select Keep Lookup Around from the windows menu while the 
  465. lookup window is in front. It will then stay on–screen until you Close it, 
  466. or until you Close the project. When you “keep around” a lookup window the 
  467. two bullets “••” at the start of the window title will change to “¶¶” to 
  468. help you distinguish the keepers from the ones that might go away later.
  469.  
  470.     Viewing other entries
  471. With at least one character selected in the lookup window, press the 
  472. <Enter> key to view the next entry in the lookup window. A selection is 
  473. automatically made for you, so in practice you can press <Enter> as soon 
  474. as the lookup window appears to see other entries without having to use 
  475. the mouse. Pressing <Enter> when you reach the last entry will return you 
  476. to the first entry.
  477.  
  478.     The <Enter> key
  479. In any text window including lookup windows, pressing the <Enter> key with 
  480. an insertion point means “look it up”. The I–beam should be just to the 
  481. right of the term you want looked up. Pressing the <Enter> key when 
  482. characters are selected never activates lookup. In lookup windows, 
  483. pressing <Enter> with characters selected means “show me the next match”, 
  484. whereas in regular text windows nothing much will happen—it will jump your 
  485. selection into view if you’ve scrolled away, but that’s it. 
  486.  
  487. So: to look up a term in any window, click just to the right of it and 
  488. press <Enter>, or type it and press <Enter>; and to cycle through the 
  489. matches in a lookup window, press <Enter> when characters are selected.
  490.  
  491. Looking up something in a lookup window
  492. It’s the same as any text window—click to get an insertion point just to 
  493. the right of the name you want looked up, and press <Enter>.
  494.  
  495.     If your spelling is correct
  496. If your spelling matched some term in your dictionary exactly, all the 
  497. entries will be for the same name. However, you can use the same name in 
  498. different “name spaces” in C, and your dictionary will also hold all 
  499. variations of any particular type.
  500. For example, if your source code contains:
  501.     typedef int Name;
  502. and
  503.     long *Name(int x) {-function definition-}
  504. and
  505.     extern long *Name(int x);
  506. then the lookup window for Name will show you three different entries as 
  507. you cycle through them with the <Enter> key—one typedef, and two 
  508. variations for the function.
  509.  
  510.     If your spelling is off
  511. If your spelling did not match any term in your dictionary exactly, then 
  512. you’ll see whatever entries come closest, with all variations as above. 
  513. The entries will be presented in order from best match to worst as you 
  514. press <Enter>. EnterAct is roughly as good at judging what’s close as you 
  515. would be if you made no allowance for synonyms or getting things 
  516. backwards. 
  517.  
  518. EnterAct’s lookup power is sufficient that one guideline is all you need: 
  519. when you’re not sure of the correct spelling, type your best guess, 
  520. remembering that C is case–sensitive. EnterAct will almost always retrieve 
  521. what you want on the first try.
  522.  
  523.     Using lookup windows
  524. EnterAct comes preset with a maximum of four lookup windows on–screen at 
  525. one time, and a maximum of four entries per lookup window. You can change 
  526. these limits at any time by selecting the Options command under the Edit 
  527. menu. For complex problems, you may want more lookup windows. If your 
  528. recollection of the spelling of a term has gone out the window, you may 
  529. want to temporarily increase the number of alternate entries returned per 
  530. lookup window. You can vary the number of lookup windows from 1 to 10, and 
  531. the number of entries per window from 1 to 20.
  532.  
  533.     Seeing where a term is defined
  534. Select the entire term, and choose Find Definition. This will open the 
  535. file where the term is defined, and will usually show you the defining 
  536. instance of the term. <Option>double–clicking on a term does the same 
  537. thing, but doesn’t work with full method names, which consist of two words 
  538. separated by colons. For those, you will need to use Find Definition. For 
  539. more on this, see the “Browsing” chapter.
  540.  
  541.     Paste Selection Behind
  542. Once you get used to it, Paste Selection Behind can replace many of the 
  543. Pastes you do when creating code. Given a selection in your front window, 
  544. Paste Selection Behind will; Copy the selection, bring the next–to–front 
  545. window to the front, and Paste what was copied into the new front window. 
  546. This is undoable, and the selection in your next–to–front window is shown 
  547. outlined beforehand to help you anticipate what will happen. Paste 
  548. Selection Behind is especially handy with lookup windows—switch to a 
  549. lookup window, select a member name or prototype, and Paste Selection 
  550. Behind takes you back to your working window with what you want pasted in.
  551.  
  552.  
  553.     Balance
  554. Balance checks all of the paired delimiters in C (with the picky exception 
  555. of angle brackets <>). If you select an insertion point at the top of a 
  556. file (with <Option><up arrow>, or Go Top), Balance will balance your 
  557. entire file. If any error in balance is detected, you’ll be shown the 
  558. mismatched or unmatched delimiter. When balancing a file, if you hear a 
  559. beep and the insertion point remains at the top of the file, that means 
  560. your whole file balanced.
  561.  
  562. Balance also detects nested comments, and more importantly any single 
  563. failure to properly start or end a comment, something even most compilers 
  564. don’t do. There is a minor penalty to pay for this improved checking: you 
  565. can’t use a comment start or end within a comment. If you do have a 
  566. comment start or end within a comment, putting a space between the '*' and 
  567. the '/' will render it harmless. Since EnterAct’s dictionary–builder 
  568. checks comments fully, simply by building the dictionary you will 
  569. guarantee that no improper comment in any of the included source files 
  570. will ever generate a wild pointer or an uninitialized variable.
  571.  
  572.     Searching
  573. The Find dialog in EnterAct is modeless, which means that when the Find 
  574. dialog is in front any search command you pick will apply to the window 
  575. just behind it. An important exception is Replace All, which is not 
  576. undoable and works only when a text window is in front. 
  577.  
  578. The little buttons in the lower–right of the Find dialog allow to to set 
  579. up a general multi–file search of your project files. As you click them, 
  580. you’ll see bullets appear beside files to be searched in your project 
  581. window. To “fine–tune” your multi–file search selection, hold down the 
  582. <Option> key and click on or drag over the file names right in the project 
  583. window. 
  584.  
  585. A popup menu at the top of the Find dialog remembers the 20 most recent 
  586. strings of characters that you have searched for.
  587.  
  588.     Little things
  589. If you hold down the <Option> key while clicking in the zoom box of a 
  590. window, only the length will be affected—the bottom of the window will 
  591. grow down to the bottom of your screen.
  592.  
  593. When you double–click on a file in the project window to open the file, 
  594. the project window will retreat behind all other windows. If you lose 
  595. sight of the project window, you can bring it to the front by selecting it 
  596. from the Windows menu or using the key command <Command><zero>. Even on 
  597. small screens this allows you to have a large project window and use it 
  598. conveniently as a “mini Finder”.
  599.  
  600. Paste preserves relative indentation, at least in the commonest situations 
  601. where you would want your indentation to be retained. Most of the time you 
  602. won’t need to use Shift Left or Shift Right after pasting in a block of 
  603. code. If you don’t get it working first try, see the “Paste preserves 
  604. indentation” section in the “Editing” chapter.
  605.  
  606. You can Copy a file name from the project window.
  607.  Windows remember their last saved location, unless you select otherwise 
  608. from the Options dialog. 
  609. Under MultiFinder, EnterAct takes special care of your text documents (see 
  610. “Switching to other applications”). 
  611. Reformat Selection is handy for making comments pretty again after you’ve 
  612. chopped them up (it’s undoable, and some Options are available). 
  613.  
  614. There are some other things worth trying out, especially markers, but you’ll
  615. find them easily  as you browse through the rest of this manual. 
  616.  
  617.     Did I say browse?
  618. When you build yourself a project that contains classes, try out the Browse command to see a
  619. graphic view of your classes. Double–click on a class name to view the class definition,
  620. click–and–hold briefly on a class name to select from a list of methods, and then view the method
  621. definition. If you’re new to C++ and all that, you’ll find no better way to learn than by exploiting
  622. EnterAct’s project–building, lookup, and browsing power—in fact, you might want to build a
  623. project for THINK C’s ArtClass demo right now. Incidentally, here’s a shortcut to adding all of the
  624. source and header files in THINK C’s class library folder: first add a dummy text file (call it
  625. “_junk” or somesuch) at the top level of the folder containing the source and header folders; then
  626. hold down all three of the <Shift>, <Option>, and <Command> keys while selecting the Add All In
  627. Folder command; double–click on your “_junk” file and all files in all subfolders will be added to
  628. your project.
  629.  
  630.     Dictionary restrictions
  631. There are three sorts of code constructions that are nominally correct, but throw off EnterAct’s
  632. dictionary–builder. Please read the next chapter “Not everything goes” if the very notion bothers
  633. you, or trust my assertion that unless you are doing sophisticated cross–platform development,
  634. the one restriction of the three that you might ever conceivably encounter will not apply.
  635.  
  636.  
  637. If you’ve tried things out for yourself while taking this tour, I expect you know enough about
  638. EnterAct to begin using it full–time for code creation and review—aside from knowing when to
  639. poke the <Enter> and <Option> keys, there isn’t much to it. Eventually, alas, you should probably
  640. read the rest of the manual. Personally, I enjoy reading manuals.
  641.     
  642. ----------------------------------------------------------
  643. Not everything goes
  644. ----------------------------------------------------------
  645.  
  646. EnterAct is able to identify terms in your code and correctly deduce the type and definition of 
  647. each term without doing extensive preprocessing or semantic analysis. The benefits are lightning 
  648. speed and considerable tolerance of first–draft errors. The drawback is that EnterAct cannot deal 
  649. with absolutely everything that is possible in C, and three minor restrictions must be satisfied in 
  650. order for the dictionary–builder to deal properly with your code.
  651.  
  652. In practice, only the “illegal aliases” will stop the dictionary builder, whereas noncompliance 
  653. with the other two restrictions will result in extra or missing dictionary entries for some terms.
  654.  
  655.     Aliases
  656. Defined equivalents for certain keywords and punctuation should be avoided. A defined equivalent 
  657. or alias takes the form
  658.     #define    Record     struct
  659. for example. EnterAct won’t know that “Record” is supposed to mean “struct”, and the 
  660. dictionary–builder won’t work well at all.
  661.  
  662. The complete list of keywords that should not be aliased:
  663.     asm        enum        pascal        Pascal        
  664. struct        typedef    union        void        class
  665.  
  666. The complete list of punctuation that should not be aliased:
  667.     ;    :    ,    \    "    '    {}    ()    []
  668.     /    *    =
  669.  
  670. You will never see aliases for any of these in published code, or in any code intended to be read by 
  671. more than one person, for the simple reason that such a creature as
  672.     Record fileData BEGIN int x SEMI END SEMI
  673. would be rather difficult for anyone but the author to read.
  674. Other aliases, such as
  675.     #define    EQ    ==
  676. are perfectly OK, by the way.
  677.  
  678.     Obviously unnecessary parentheses
  679. These are just as rare as the aliases above. This restriction applies only outside of function bodies 
  680. and refers only to parentheses that would result in a variable declaration resembling a function 
  681. declaration. An example would be
  682.     Peter    (Harvey);
  683. Right now you know as much as EnterAct does when it runs into this sort of thing—is it a variable 
  684. declaration or a function declaration? You may have deduced that the above declaration is almost 
  685. certainly for a function “Peter” returning an (implicit) int, since you would never type those 
  686. parentheses in a simple variable declaration,
  687.     int    (x);
  688. —these are an example of what is meant by “obviously unnecessary parentheses”, namely 
  689. parentheses that make the code harder to read, not easier. If you avoid these excessive 
  690. parentheses when declaring variables outside of a function, that’s all that’s needed. Once again, 
  691. you won’t see them in any published code, and even beginners feel that such parentheses make life 
  692. harder, not easier.
  693.  
  694.     All–or–nothing macro’s
  695. This final restriction is one that you may run into.
  696. An “all–or–nothing” macro is a macro that looks something like
  697.     #ifdef        BLUETREECOMPILER
  698.     #define P(x)        x
  699.     #else    /* some other compiler */
  700.     #define P(x)
  701.     #endif
  702. —so P(x) either does nothing at all to its argument or it “eats” the argument, but either way the 
  703. macro itself disappears from the code. If such a macro is the very first thing in a statement then 
  704. EnterAct will deal with it correctly, for example
  705.     P(typedef  int  INT16;)
  706. would result in INT16 being recorded as a typedef’d equivalent of “int”. 
  707.  
  708. However, if the all–or–nothing macro is not the very first thing in the statement, as in
  709.     int    myFunc P((int x, long y));
  710. then EnterAct will mistakenly record “P” and not “myFunc” as the function name, and in general 
  711. it will misrecord any similar statement where an–or–nothing–macro isn’t the first thing in the 
  712. statement.
  713. In case you’re wondering, the intention of
  714.     int    myFunc P((int x, long y));
  715. is to produce either
  716.     int    myFunc (int x, long y);
  717. or
  718.     int    myFunc ();
  719. - in other words either a proper modern prototype or an old–fashioned declaration, and this sort of thing
  720. is useful when writing code that will be compiled using different compilers.
  721.  
  722. What to do? Call up the "Macro's to skip..." dialog from the EnterAct menu, and enter the name 
  723. of the macro there.
  724.  
  725. If there is still a problem, please give tech support a call—given a full description of your macro trouble, 
  726. we will probably be able to come up with a fix.
  727.     
  728. ----------------------------------------------------------
  729. Projects
  730. ----------------------------------------------------------
  731.  
  732.     Introduction
  733. Any collection of TEXT or PICT files from up to 6 disks can be added to an EnterAct project. Use 
  734. New Project, followed by Add Files or Add All In Folder, and then Update Dictionary to build a 
  735. complete project. Even if 200 files are involved the whole process from start to finish shouldn’t 
  736. take more than three minutes on a Mac II. 
  737.  
  738.     What a project must contain
  739. TEXT or PICT files. The source and header files don’t have to add up to a compilable 
  740. application—anywhere from one file to part or all of the source and documentation for several 
  741. applications can be an EnterAct project. The only limits are available memory and the nuisance of 
  742. having slower lookup when your spelling is off if the project has a huge dictionary. This works the 
  743. other way too—you’ll need less memory and have faster lookup if you leave out source or header 
  744. files that are logically part of your project but for which you don’t need regular access or lookup.
  745. An EnterAct project can contain files from up to 6 disks. If your project files are split across 
  746. several disks, you should have all the disks on–line (mounted) before updating your dictionary or 
  747. doing a multi–file search. EnterAct tracks your disks by name, and many other applications do the 
  748. same. Please ensure that all your disks have different names. If you ever find it necessary to 
  749. move a considerable number of files from one folder or disk to another, the simplest way to deal 
  750. with the change in any EnterAct project that refers to those files is to throw the project away 
  751. and create an new one. If only a few files are moved, you can use Remove File followed by Add 
  752. Files and then Update Dictionary afterwards to update your project.
  753.  
  754.     Creating a project
  755. Select New Project from the EnterAct menu at any time. When you start EnterAct by 
  756. double–clicking on its icon, you’ll see the New Project dialog if you cancel the Open Project dialog 
  757. during the startup. Since the the project will always be saved for you automatically, there’s no 
  758. such thing as an “Untitled” project: you’ll have to give it a home on your disk before doing 
  759. anything with it.
  760.  
  761.     Three panes—.c, .h, plain text
  762. Any files you add to your project whose names end in .c or .C will be placed in the left pane, which 
  763. is reserved for source files. Header files (ending in .h or .H) will go in the middle pane, and any 
  764. other TEXT files that you add will end up in the right pane. PICT’s will also be placed in the right 
  765. pane. If you have special file extensions after a period, eg “.Proto”, that you would like to have 
  766. treated as source or header files, see the “Custom file extensions” section a few pages on.
  767. In each pane, the files are sorted alphabetically by name. Since EnterAct is not a compiler, there’s 
  768. no need to set up code segments.
  769.  
  770.     Add Files—the old–fashioned way
  771. The Add Files command will let you repeatedly add files (one at a time) to your project, until you 
  772. cancel the dialog. The appropriate pane for each file will be chosen for you. The type of the file 
  773. you add can be TEXT or PICT.
  774.  
  775.     Add Files—the fast way
  776. Select Add All In Folder. Open a folder that contains files to be added, and select one of them. When 
  777. you click the Add button, that file and all other TEXT files in the folder will be added to your 
  778. project. Files in sub–folders will not be added. This command will also repeat until you click the 
  779. Cancel button.
  780.  
  781. If the file you select is a PICT, it will be added, but other PICT’s in the folder will not 
  782. automatically be added. In any case, all TEXT files will be added. As with Add Files, there’s no 
  783. need to select a project pane beforehand.
  784.  
  785. On the rare occasion, you may want all files in all subfolders to be added to your project as
  786. well: to have this happen, hold down all three of the <Shift>, <Option>, and <Command> keys
  787. while using your mouse to pick Add All In Folder (the key command won’t work). This
  788. special case can be interrupted with <Command><period>, in case you accidentally do it while
  789. at the root level of your 300 Meg drive....
  790.  
  791.     Add Mac Headers
  792. The Add Mac Headers command will search the folder that contains EnterAct and all sub–folders 
  793. for the file “Quickdraw.h”. Wherever it is found, all files in that folder will be added. If you have 
  794. not placed your Macintosh #include files in accordance with THINK C’s installation instructions 
  795. (HardDrive: THINK C: Mac #includes) you may see a message from EnterAct mentioning that 
  796. “Quickdraw.h” wasn’t found anywhere.
  797.  
  798.     Add Standard C Headers
  799. The same as Add Mac Headers, except that all files in the folder containing “stdio.h” will be added 
  800. to your project. This file is typically in HardDrive: THINK C: C Libraries: headers.
  801.  
  802.     Remove File
  803. To remove a file from a project, bring the project window to the front, select the file by clicking 
  804. on it, and then select Remove File. If you have built a dictionary for the project, the dictionary 
  805. will be automatically updated for you.
  806.  
  807. There is no “Remove All Files In Folder” command, just the one–file–at–a–time Remove File, so if 
  808. you accidentally add all the files in the wrong folder it will probably be quickest to just start over 
  809. with a new project. This shouldn’t take long
  810.  
  811.     Custom file extensions
  812. The “File Extensions...” command under the EnterAct menu allows you to specify additional file 
  813. extensions beyond the standard .c, .C, .h, and .H. Type in your own extensions (up to 6 
  814. extensions, each up to 5 characters), and pick which pane the file should be added to. For example 
  815. to have “.Proto” files added to the middle pane type in “Proto” in one of the extension fields and 
  816. click the corresponding “Mid pane” button. Extensions are case-sensitive, so “PROTO” is not the 
  817. same as “Proto”. If you have multiple versions of the same extension, you should enter them 
  818. separately.
  819.  
  820. If a project is open when you pick “File Extensions...” the extensions you enter will apply to that 
  821. project only, as indicated by the “This project” button. If no project is open at the time, the 
  822. extensions will be used for any new project you create (the bottom-left button will read “New 
  823. projects” in this case).
  824.  
  825. PLEASE NOTE any file that is added to the left or middle panes will be parsed, and terms contained 
  826. will be built into your dictionary. This means the files must be in C (or at least “C--”), otherwise 
  827. the dictionary-builder will complain.
  828.  
  829.     Distinguishing ".h" from <.h>
  830. The ".h" and <.h> buttons in the Find dialog let you set up a multi–file search for just one kind of 
  831. header (ie system or your own), and since bullets • are shown beside selected files selecting one 
  832. or the other kind will give you an on–screen way of telling which are which.
  833.  
  834. Note for this to work properly your system headers should be in the same folder as EnterAct 
  835. itself, and your own headers should be in a folder outside the one that holds EnterAct and THINK C.
  836.  
  837.     Copy and search in the project window
  838. When you have a file name selected in the project window, you can Copy it and then Paste it into a 
  839. text window. This helps sometimes with documentation. 
  840.  
  841. With the project window in front, pressing any key will scroll the current project pane to the 
  842. first file name that begins with the single character you typed. This is something like a file open 
  843. dialog, but responds to just one character at a time.
  844.  
  845. And, if you have an enormous project, the Find dialog will let you search for part or all of a file 
  846. name in a particular pane. Select the pane in the project window that you wish to search, call up 
  847. the Find dialog, and then continue as though you were searching for something in a text document.
  848.  
  849.     Tips
  850. When you double–click on a file–name in the project window to open a file, the project window will 
  851. at the same time move to the back behind all other windows. If the project window becomes 
  852. hidden, you can bring it to the front again by selecting it from the Windows menu or using the 
  853. menu key equivalent <Command><zero> which is always for the project window. Since the project 
  854. window goes all the way front or back with a key–stroke or double–click, you can if you wish 
  855. make the project window relatively large and treat it as a sort of backdrop mini–Finder.
  856. If you begin the names of your own header files with a common character or group of characters, 
  857. they will end up grouped together in the middle pane of your project window.
  858.  
  859. You shouldn’t add more than 16,000 files to one pane. You wouldn’t want to anyway, since 
  860. EnterAct will start to bog down noticeably if you go beyond about 500 files total for all panes. 
  861. However, if you’re patient and have enough RAM you can build an enormous project, and in the end 
  862. lookup will still be instantaneous if your spelling of a term is exact. If your spelling is off, you’ll 
  863. be “in for the long wait” as a friend of mine puts it, so it would be best to think of enormous 
  864. projects as strictly for review and learning purposes (where you can click and <Enter> beside any 
  865. term you see and be assured that lookup will be immediate) rather than for creating new code.
  866.     
  867. ----------------------------------------------------------
  868. Dictionaries
  869. ----------------------------------------------------------
  870.  
  871.     Introduction
  872. Dictionaries contain entries for virtually everything in every .c or .h project file that is not 
  873. restricted in scope to the body of a function, struct, or union. For functions and methods the 
  874. dictionary entry will be the prototype or equivalent, and for all other terms the entry will consist 
  875. of the entire statement in your source code in which the term was mentioned or defined. Regular 
  876. use of Update Dictionary (or Update Dictionary From Disk) will keep your dictionary current as 
  877. you develop your source code.
  878.  
  879.     What’s in a dictionary
  880. After you’ve built your dictionary with the Update Dictionary command (see the next section), it 
  881. will contain entries for everything of interest in .c and .h files that you would want to use in more 
  882. than one  function. Specifically there will be an entry for every:
  883.     function—all types including static, in–line, method
  884.     struct, union, enum, class
  885.     enum constant
  886.     #define—constant and macro
  887.     typedef
  888.     variable—all types including static, low–memory
  889. —provided only that the term is defined or mentioned outside of a function, struct, or union body.
  890. Dictionary entries for functions and methods will contain the prototype or equivalent. For all other 
  891. kinds of terms, the dictionary entry will consist of the complete C statement in which the term 
  892. occurs in your source code.
  893.  
  894. All variants of a particular term will be included as separate entries in the dictionary. For 
  895. example, if your source code contains the definition of a function and also a prototype for the 
  896. function, then two entries for the function will be made in the dictionary. You can view other 
  897. entries by pressing <Enter> again after the lookup window appears—see the “Lookup” chapter for 
  898. details.
  899.  
  900. To make it into your dictionary, the term must be defined or mentioned outside of a function, 
  901. struct, or union body. For example, if you place the definition of a struct inside a function body 
  902. there will be no entry in your dictionary.
  903.  
  904. Any terms inside the standard “#if 0 ... #endif” construction won’t be included in your 
  905. dictionary. However, terms inside any other sort of conditional construction (such as “#ifdef 
  906. SomeThing ... #endif”) will be included*.
  907.  
  908.     Building your dictionary
  909. After you’ve added all your files to your project, select Update Dictionary from the EnterAct 
  910. menu. If the dictionary–builder stumbles over a statement that’s too mangled to parse, you’ll see 
  911. a message explaining in general what the problem is. You’ll also see the file in question, with the 
  912. cursor placed at the position where the error was detected. Generally, most problems reported 
  913. will be well–localised and fairly easy to fix—typical problems are lack of balance for critical 
  914. delimiters, and missing or very badly spelled keywords. If you don’t see what the problem is, 
  915. consult the “Dictionary build problems” section of the last chapter, ”If there’s a problem”, and 
  916. the “If there’s a problem” section at the end of this chapter.
  917.  
  918. EnterAct’s dictionary–builder will properly interpret a great many first–draft errors, including 
  919. missing semi–colons, lack of balance in some delimiters (these vary according to context), 
  920. slightly misspelled keywords, and nearly all errors, except for certain delimiters, that occur 
  921. within the bodies of function and struct, union, or class definitions.
  922.  
  923. In other words, your code may be far from compilable and yet produce no complaints when 
  924. EnterAct builds the dictionary. Yet, in a contrary sort of way, using EnterAct will almost 
  925. certainly reduce your first–draft errors. This is simply because you now have instant access to 
  926. all spellings and types of struct members, all function calls, etc, so a major source of errors is 
  927. now gone. And the time you save by using EnterAct’s lookup and editing capabilities might be 
  928. partly devoted to reviewing your code before submitting it to the compiler, once again using 
  929. lookup to clarify details when needed.
  930.  
  931.     Keeping it up to date
  932. EnterAct does not update your dictionary automatically. Generally, you should select Update 
  933. Dictionary whenever you change or add something that you’d like to have in the dictionary. 
  934. Changes that take place entirely within the body of a function will not affect what’s in your 
  935. dictionary. Any changes outside of a function body, including adding a new function, adding or 
  936. changing an enum constant or struct or class member etc will be changes that you’d normally like 
  937. to have reflected in your dictionary. 
  938.  
  939. Update Dictionary will rebuild the dictionary only for those files that have been changed since the 
  940. last update. However, EnterAct will not be aware of any changes to files that you made using 
  941. some other application. So, if you don’t recollect that all of the changes you made with some other 
  942. application were entirely within function bodies, select Update Dictionary From Disk to bring your 
  943. dictionary thoroughly up to date.
  944.  
  945. Update For Front File Only will rebuild only that part of your dictionary that is determined by the 
  946. front text window. Unlike the other two update commands, this is a “manual override”, and 
  947. rebuilds the dictionary for the front file whether or not it needs rebuilding. Normally you won’t 
  948. need to use this command, because a full update with Update Dictionary for all changed files is 
  949. almost always very quick. In fact, off hand, I can’t think of any use for the Update For Front File 
  950. Only command. But it’s there if you want it. 
  951.  
  952.     How long will it take?
  953. Typically an update zips along at two to three files per second on a Mac II once it gets 
  954. going—comparable more to multi–file search speed than compilation speed. There is a bit of 
  955. overhead for an update, so an update for just one file may take for example three to four seconds 
  956. in a project with a total of one Meg of source and header files. An update for six changed files in 
  957. that size of project would take about six seconds. However, no conditional rebuilding is ever done, 
  958. meaning that no matter which single file is changed, the dictionary–builder will reanalyse only 
  959. that file and no others, even if it is the sort of header file that is #included everywhere.
  960. Selecting Update Dictionary From Disk rather than Update Dictionary will typically add no more 
  961. than two seconds per 100 files to the total rebuild time.
  962.  
  963. If you need to interrupt the dictionary update, press <Command><period>. This also interrupts 
  964. multi–file searches, and printing, by the way. You can finish the job off properly later by 
  965. reselecting your original dictionary update command.
  966.  
  967.     Show Dictionary
  968. This command just produces a “raw” dump of all the text in your dictionary, consisting of all the 
  969. definitions or declarations that the dictionary–builder extracted from your code. You might find 
  970. this command useful for extracting a list of “near–prototypes” for all of the functions in a file. 
  971. The entries in the dictionary dump will be grouped together by file, and within each file will 
  972. appear in the same order as they occurred in the original file. This typically means that the 
  973. entries taken from the definitions of all functions in a file will be grouped together in a file. Find 
  974. one with a search, and you’ve found them all. You’ll have to add semicolons (and rework the 
  975. parameters if you use “old–style” function definitions), but you will be able to grab all the 
  976. “near–prototypes” with a single Copy.
  977.  
  978.     If there’s a problem
  979. See also the “If there’s a problem” chapter, especially the “Dictionary build problems” section.
  980.  
  981. If you run into an “Unbalanced comment” message, and you are one of those people who intentionally
  982. uses doubled comment starts, as in
  983. /*#define Humpty /*break no eggs if not defined */
  984. you can get around this by selecting Options and unchecking the “Detect nested comment starts” option.
  985. Keep in mind though that this will partially disable EnterAct’s ability to trap comment errors.
  986.  
  987. If the problem seems to involve a macro, see the last page of the “Not everthing goes” chapter for a
  988. discussion of the Macro's to skip command.
  989.  
  990. The messages that EnterAct displays when it runs into a problem are moderately long, often with a
  991. suggestion as to how the problem might be fixed.
  992. Most errors encountered during dictionary updating that produce a message will either be very close to
  993. the position of the cursor in the file you are shown or will be due to lack of balance in some delimiter.
  994. If the problem seems to be lack of balance, the message will suggest that you try the Balance command
  995. immediately after OK’ing the alert message. In particular, EnterAct accurately detects all single
  996. failures to properly start or end a comment (unless you choose to ignore comment start errors as
  997. described on the preceding page). If the problem isn’t with balance, the error will usually be very
  998. close to the cursor, and will typically be a misspelling, or missing or wrong punctuation. In rare cases
  999. the error may be at the other end of the single statement where the cursor is, but that’s the worst
  1000. case.
  1001. Minor misspellings of some keywords won’t be a problem, but there is a limit:
  1002.     typdef sturct Something...    is OK, but
  1003.     twerpdeaf stork            is not.
  1004. EnterAct does not detect all misspelled keywords, and will often tolerate a repeated keyword, but in
  1005. those cases it won’t matter for the purpose of building a dictionary.
  1006. EnterAct’s tolerance of errors complicates repairing multiple serious errors, since you may fix an
  1007. error only to discover that EnterAct didn’t mind that one, and shows you the same error message again.
  1008. Be consoled that any errors you do fix would have to be fixed anyway at compile time.
  1009.  
  1010. Although it’s extremely unlikely that you’ll run into this, keep in mind that EnterAct cannot properly
  1011. handle certain theoretically possible constructions, having to do mainly with #defined equivalents for
  1012. important keywords and punctuation, and with the perverse misuse of round brackets. See “Not
  1013. everything goes” for details.
  1014.  
  1015. The method of second–last resort: take your files to THINK C and compile them. 
  1016. The method of last resort? 1-416-595-9440.
  1017.     
  1018. ----------------------------------------------------------
  1019. Lookup
  1020. ----------------------------------------------------------
  1021.  
  1022.     Introduction
  1023. With a bit of practice, you should find that the entry you want will be among the first three
  1024. shown almost all of the time, no matter how shaky your memory is. The reason is that even in a
  1025. very large project there are remarkably few names that are similar to one another—a credit to
  1026. natural inventiveness when it comes to naming things, and a small blessing that EnterAct allows
  1027. you to take advantage of. Almost every name that you or someone else creates will be distinctive in
  1028. some way, and the distinctive part is the part that you’ll remember best. That’s all EnterAct
  1029. needs.
  1030.  
  1031. Completely automatic lookup is also available: select AutoLook, and put the AutoLook window
  1032. somewhere handy. You’ll be surprised at how often it retrieves the information you want, just
  1033. before you realise you need it!
  1034.  
  1035.     Click, press <Enter>
  1036. To look up a term in your dictionary, either type it in or click just to the right of it and press 
  1037. <Enter>. If you supply an optional hint (see “Hints for speedup” below) you should press <Enter> 
  1038. with the insertion point just to the right of the one–character hint. 
  1039.  
  1040. A lookup window will appear showing the best dictionary entry that matches what you typed. If it 
  1041. is not the exact entry you wanted, press <Enter> again to see more entries
  1042.  
  1043. When you have one or more characters selected in a lookup window, pressing <Enter> means 
  1044. “show me the next entry”. The total number of entries is shown on the right side of the display 
  1045. box at the window bottom, just after the number of the current entry you are viewing. Since a 
  1046. selection is made for you automatically whenever a new entry appears, pressing <Enter> 
  1047. repeatedly will take you through all available entries in the lookup window (and back to the first 
  1048. entry at the end).
  1049.  
  1050. To view the previous rather than next entry, hold down the <Option> key while pressing <Enter>.
  1051. The display box occupying part of the scroll bar space along the bottom of the lookup window will 
  1052. show you, from left to right: the file that the entry was taken from; a one–letter abbreviation 
  1053. indicating the type of entry (# for define, s for struct etc), and then the current entry and the 
  1054. total number of entries available in the lookup window. For a full list of the one–character 
  1055. abbreviations, see the “Hints for speedup” section below. 
  1056.  
  1057.     Your spelling
  1058. If your spelling exactly matches any term in your dictionary, you will be shown all entries that 
  1059. match exactly, up to a maximum of 60. They will be presented in no particular order. Since the 
  1060. dictionary builder records all variants, there may often be, for example, three different entries 
  1061. for a function—defining instance, prototype, and prototype with “extern” at the start. (Some 
  1062. people like to prototype a function without the “extern” at the top of the file where it is defined, 
  1063. so the list of prototypes there serves as a table of contents: and placing “extern” at the 
  1064. beginning of a prototype when it is being called in another file makes it obvious that the function is 
  1065. defined somewhere else.)
  1066.  
  1067. EnterAct’s lookup is always case–sensitive. This is not optional, because C is always 
  1068. case–sensitive. If you’re just starting C, you’ll find good guidelines for capitalization at the start 
  1069. of the first volume of Inside Macintosh.
  1070.  
  1071. If your spelling does not exactly match any term in your dictionary, you will be shown the entries 
  1072. that come closest. The number of entries in the lookup window is in this case up to you, as set by 
  1073. the “Number of entries per lookup window” option in the Options dialog. If you suspect in a 
  1074. particular case that your spelling might be way off, you might want to temporarily increase the 
  1075. number of entries kept to 10 or more to improve your chances of retrieving the one you want. 
  1076. Normally, the default setting of 4 entries per lookup is adequate, though you might prefer 3 or 5 
  1077. on a regular basis. You can change this option at any time. There is no significant speed penalty for 
  1078. increasing the number of entries kept.
  1079.  
  1080. Lookup retrieval when your spelling is exact is always immediate, whereas the time taken when 
  1081. your spelling is off will be typically a few seconds. This time varies on average directly with the 
  1082. size of your dictionary, although it can vary in particular cases. If lookup on average takes longer 
  1083. than you’re willing to wait, the simplest cure is to trim unneeded files from your project, thus 
  1084. reducing the size of your dictionary. Second–best is to speed up your Macintosh (plugging in to 
  1085. 600 volts will provide only a temporary speedup).
  1086.  
  1087.     Hints for speedup
  1088. When you type in a name and press <Enter>, you know what “kind of thing” you want, but 
  1089. EnterAct doesn’t. Supplying EnterAct with a quick hint will help speed up the lookup if your 
  1090. spelling doesn’t match an entry, and it will in all cases limit the entries that are retrieved to the 
  1091. type that you specify with the hint.
  1092.  
  1093. A hint for lookup consists of one character added after the name you wish looked up. Normally 
  1094. you’ll need to first type a space and then the one–character hint, to separate it from the name. 
  1095. However, the hint for a function “(” and the hint for a #define “#” can’t be part of any name, so 
  1096. you don’t need a space for these two.
  1097.  
  1098. Here are the hints you can supply, with examples: in all cases you should select an insertion point 
  1099. just to the right of the hint just before pressing <Enter> so that EnterAct can pick up the hint 
  1100. correctly. For all except the function and #define hints, a bit of space (blanks or tabs) between 
  1101. the name and the hint is necessary.
  1102.  
  1103. Type                                Hint        Example
  1104. function, method            (            SomeFunc(
  1105. struct, class                    s            MyStruct s
  1106. variable                        v            globalVar7 v
  1107. #define                            #            BIGNUM#
  1108. union                                u            IntOrFloat u
  1109. enum                                e            ErrorCodes e
  1110. enum constant                c            noMemory c
  1111. typedef                            t            MyStruct t
  1112.  
  1113. In the display box of a lookup window you will see one of the above hints for each entry, between 
  1114. the file name and the current entry number. This is just to remind you that EnterAct keeps track 
  1115. of what kind of thing each term is, and that it will understand the above hints if you supply them.
  1116. When should you supply a hint? Almost never. Perhaps when you have a struct, a typedef, and a 
  1117. variable that have very similar names, you don’t remember the exact spelling, and you want just 
  1118. one of them without the nuisance of the others. Since flipping through lookup entries is as fast as 
  1119. pressing the <Enter> key once the lookup appears, the only common reason to supply a hint is to 
  1120. speed up the lookup process itself. But in this case you should first try trimming unnecessary files 
  1121. from your project, as this will also speed things up by reducing the size of your dictionary.
  1122.  
  1123.     Number of lookup windows
  1124. With too many lookup windows on–screen at once, your screen will be too cluttered. If too few are 
  1125. available, that will hamper you when you have a complicated problem to wrestle with. The upshot 
  1126. is that the maximum number of lookup windows on–screen at once must be under your control, so 
  1127. you can vary this number as the situation demands. You can change this number at any time by 
  1128. typing a new number in the “Number of lookup windows” box in the Options dialog. The default 
  1129. number is 4, but you can vary it from 1 to 10.
  1130.  
  1131. The “Number of lookup windows” includes any that you mark for keeping around, and determines 
  1132. when a lookup window that is not marked for keeping around will quietly go away on its own. When 
  1133. you press <Enter> to see a new lookup and the lookup window limit has already been reached, one 
  1134. of the old lookup windows that was not marked for keeping around will quietly go away, and the 
  1135. new one will replace it. There’s no predicting which one, so if you want a lookup window to stay 
  1136. up until you explicitly close it, select Keep Lookup Around while it is the front window ( see 
  1137. “Keeping lookups around” below for details).
  1138.  
  1139.     Number of entries per lookup
  1140. When your spelling doesn‘t match any term in your dictionary exactly, the number of entries that 
  1141. are retrieved in the lookup window is under your control. To change this number, select Options 
  1142. and type a new number in the “Number of entries per lookup window” box. The default of 4 suits 
  1143. most cases, but you may prefer 3 or 5. The maximum of 20 entries is useful only when your 
  1144. recollection of the correct spelling has gone right out the window.
  1145.  
  1146.     Keeping lookups around
  1147. The command for this is under the Windows menu. When you select Keep Lookup Around with a 
  1148. lookup window in front, the lookup will be marked for keeping around. It won’t close unless you 
  1149. close it yourself. Other lookups not marked for keeping around may quietly close when you ask for 
  1150. a new lookup after having hit the limit of the number of lookup windows on–screen at one time.
  1151. When you select Keep Lookup Around for a lookup window, the beginning of the window title will 
  1152. change from •• to ¶¶ to show you that it is marked for keeping. A ¶ is a Paragraph mark, which 
  1153. starts with P, and that stands for Permanent.
  1154.  
  1155. A lookup window marked for keeping will close only if you select Close or Close All, or close the 
  1156. project, or leave EnterAct.
  1157.  
  1158.     AutoLook 
  1159. The AutoLook command calls up an automatic lookup window which updates by itself to
  1160. show dictionary entries as you type, edit, or click around with the mouse. It shows only exact
  1161. matches, and only one match at a time. Incessantly, with near–maniacal fervor, it will retrieve
  1162. and display a definition for the word that lies just before your insertion point, or at the end of
  1163. your current selection. For example, if there are entries in your current dictionary for
  1164. “Window”, “WindowData”, and “WindowDataPtr”, then all three entries will appear in
  1165. succesion in the AutoLook window as you type “WindowDataPtr”. Note that double–clicking on a
  1166. word will produce results in the AutoLook window.
  1167.  
  1168. Since the AutoLook window changes so often, if you want to preserve an entry you should look it
  1169. up in the usual way, by clicking just to the right of the word (or partial word—it doesn’t matter
  1170. what’s to the right of the insertion point) and pressing the <Enter> key. You can do the
  1171. click–and–<Enter> in the AutoLook window if you wish.
  1172.  
  1173.     Paste Selection Behind
  1174. This command is described briefly here because it is the easiest way to copy something from a 
  1175. lookup window and paste it into your working window. Details are in the next chapter, “Editing”.
  1176. When you look up a function name, the function’s prototype or equivalent will appear in the lookup 
  1177. window with the function name and parameters preselected; at the same time, the function name 
  1178. that you typed in your working window will be selected (shown with a thick outline since it is not 
  1179. the front window). To  paste a “template” for the function call into your working window, select 
  1180. Paste Selection Behind. This command will Copy what’s selected in the lookup window, switch to 
  1181. your working window, and Paste over what is selected there.
  1182.  
  1183. Paste Selection Behind is also handy when you’re working with a struct and would like to paste in 
  1184. member names instead of retyping them. Call up a lookup window for the struct, and mark it for 
  1185. keeping around (see just above). Then, when you need a member name in your working window; 
  1186. switch to the lookup, select the member name, and Paste Selection Behind. That will return you to 
  1187. your working window with the member name pasted in.
  1188.  
  1189. For non–functions, the lookup window appears with the matching term selected, and the term you 
  1190. typed in your working window is also automatically selected (this includes any hint you might 
  1191. have added). So correcting the spelling of a term is a matter of; press <Enter>, and when the 
  1192. lookup appears Paste Selection Behind. If the first entry you see in the lookup window is not the 
  1193. one you wanted, press <Enter> until you see the one you want.
  1194.  
  1195.     Editing an entry is temporary
  1196. If you edit a lookup entry, you will lose your changes if you cycle to another entry in the same 
  1197. lookup window. The only way to permanently change a dictionary entry is to alter the 
  1198. corresponding source code statement (the display box in the lookup window will show you which 
  1199. file the entry was taken from). 
  1200.  
  1201.     If there’s a problem
  1202. In the rare case that your dictionary is small and the name you type doesn’t match any term in the 
  1203. dictionary to any reasonable extent, you’ll just hear a beep and no lookup will appear. 
  1204.  
  1205. The hint for #defined macros is the same as the hint for other #defines—add a '#' after the name, 
  1206. rather than a '('. In general, if the lookup you see is not what you wanted and you supplied a 
  1207. one–character hint, try again without the hint.
  1208.  
  1209. Looking up classes and methods is discussed in the next chapter, “Browsing”.
  1210.  
  1211. If you suspect your spelling may be way off, try increasing the “Number of entries per lookup 
  1212. window” in the Options dialog to 10 or more, and then try the lookup again.
  1213.  
  1214. If you’re quite sure that a term should be in your dictionary but it doesn’t appear when you look it 
  1215. up, take a look at the statement where the term is defined or mentioned: you could have 
  1216. accidentally violated a required coding convention, or you could have a succession of first–draft 
  1217. errors that has confused EnterAct. A missing semicolon or misspelled keyword can result in a 
  1218. term being skipped.
  1219.  
  1220. If you employ macro’s to do such things as optionally include or omit full prototypes, or
  1221. typedef’s, then you should register them with EnterAct using the Macro's to skip command, as
  1222. described in the “Not everything goes” chapter.
  1223.  
  1224. If you run into a problem that stumps you, please compile your code in THINK C before calling for
  1225. help. However, if you end up fixing bugs in your code that you feel EnterAct should have been able
  1226. to tolerate, please call and complain.
  1227.     
  1228. ----------------------------------------------------------
  1229. Browsing
  1230. ----------------------------------------------------------
  1231.  
  1232.     The Browse command
  1233. The window produced by this command shows a “family tree” of the classes in your project, as of
  1234. your last dictionary update, and also allows you to quickly view any class or method definition. It
  1235. will close when you close your project, and will update automatically when you update your
  1236. project dictionary.
  1237.  
  1238. To view the definition of a class, double–click on the class name. This works much like
  1239. <Option>double-click or Find Definition in a text window.
  1240.  
  1241. To view a method definition, click and hold on the owning class name: after a brief pause (your
  1242. double–click time, actually) a popup menu will appear listing all of the class’s methods. You
  1243. should then select the method you want and release the mouse button, as if you hadn’t guessed.
  1244.  
  1245. Classes without proper parents (orphans, if you like) will always appear in the left–most
  1246. column of your browser window. A quick look down the left column will reveal whether you have
  1247. any unintentional orphans, perhaps due to misspelling the parent class name in the class
  1248. definition. Quite often, “CObject” is the only orphan you’ll have, but all classes declared to be
  1249. “direct” or “indirect” and hence not a subclass of any other class will also appear in the left
  1250. column.
  1251.  
  1252.     Browsing classes without the browser
  1253. Nothing new to seeing class definitions—click to the right of the class name and press <Enter>. You
  1254. will typically find the class name of an object as the first name in the statement where it is
  1255. defined, as in
  1256.     className *objectName;
  1257. You can also, of course, look up a class by typing the name and pressing <Enter>, and in all cases
  1258. your spelling just needs to be reasonably close, not exact.
  1259.  
  1260. To view the definition of a class when looking at one of the classes’ methods, see the section below.
  1261.  
  1262.     Browsing methods without the browser
  1263. Method browsing is a bit trickier, since if you have something like
  1264.     currentObject->Draw();
  1265. and there are several different classes with Draw() methods, then EnterAct does not know
  1266. specifically which Draw() method you want. If there is only one method in your project with a
  1267. given name, then the lookup window will contain just one entry, but if there are several then the
  1268. lookup window will contain all of them (up to a maximum of 60). For example, if you were to
  1269. press <Enter> with an insertion point to the right of Draw above, then the lookup window might
  1270. contain entries for void Circle::Draw(), void Square:: Draw(), void Oval::Draw() and so on. When
  1271. there are several entries like this, you can cycle through them by pressing the <Enter> key, and
  1272. back up by pressing <Option><Enter>. There are some illustrations of this two pages ahead.
  1273.  
  1274. This raises the question of how to find where a method is defined. The general approach is
  1275. described later in “Seeing where a term is defined”, but the approach for a method has one extra
  1276. step:
  1277. • first, look up the method and cycle through the lookup window until you find the method you
  1278. want, based on the name of the owning class
  1279. • then select the entire name, consisting of the owning class name, the two colons, and the method
  1280. name, in general
  1281.         className::methodName
  1282. •and then select Find Definition.
  1283. Well, there is one exception to this: if there is only one method in your project with the name in
  1284. question, then a standard <Option> double–click on just the method name will jump you to the file
  1285. where that method is defined. However, if there are several methods with the same name in
  1286. different classes, there’s no predicting which definition you will see if you just <Option>
  1287. double–click on the method name—best to look up the method first, and use Find Definition on the
  1288. full name of the exact one you want.
  1289.  
  1290. By the way, when viewing the full “className:: methodName” of a method, you can look up the
  1291. definition of the owning class of the method by clicking at the right end of the class name, before
  1292. the colons, and pressing <Enter>. If the instance of the method name you’re vewing doesn’t have
  1293. the class name attached, look up the method name as decribed just above to see the full method
  1294. name including the owning class, and then do your lookup for the class in the lookup window
  1295. shown for the method.
  1296.  
  1297. If you want to see where a method is defined, but can’t remember the exact spelling of the name,
  1298. type your best guess and press <Enter>. The true name you wanted will probably be among the
  1299. first few entries in the lookup window, and then you can proceed with an <Option> double–click or
  1300. Find Definition right in the lookup window to get to the file you want to see.
  1301.  
  1302. If you want lookup for a method when you’re not sure of the spelling, and want to restrict the
  1303. lookup to just methods, type a bit of the class name and two colons just before the method
  1304. name—even C::method will do (even if the class name doesn’t contain a “C”—it’s the two colons
  1305. which signal that a method is wanted).
  1306.  
  1307. EnterAct is not a fancy bells–and–whistles browser, but it does allow you to look everything up
  1308. quickly. And, it has two advantages over any other browser: your code doesn’t have to be perfectly
  1309. compilable, just reasonably close; and your spelling when you want lookup for anything
  1310. (including methods and classes) doesn’t have to be perfect, just close enough to be distinctive.
  1311. Try that on your SmallTalk!
  1312.  
  1313. (nice pictures here in the printed manual)
  1314. ----------------------------------------------------------
  1315. Editing
  1316. ----------------------------------------------------------
  1317.  
  1318.     Introduction
  1319. Everything that changes a document is undoable one way or another, except Replace All and 
  1320. Revert. The indentation of your code will commonly be preserved when you Paste. Paste Selection 
  1321. Behind combines Copy, switch to the next window, and Paste in one command. The selection in the 
  1322. next–to–front window is shown outlined to help in using this command. Reformat Selection can 
  1323. “pretty up” a comment or selection of text. Holding down the <Option> key while pressing the up 
  1324. or down arrow takes you to the top or bottom of your document. The rest is routine.
  1325.  
  1326.     The usual stuff
  1327. Paste Selection Behind and Reformat Selection are new editing commands. Balance has its own 
  1328. chapter following this one. All other editing operations will be familiar if you’ve used THINK C. 
  1329. Paste has been enhanced to preserve your relative indentation.
  1330.  
  1331.     Undo
  1332. EnterAct has one level of undo and redo, so if you decide to undo a change to your document you 
  1333. should do so before carrying out the next change. The undoable and redoable actions are: typing, 
  1334. Cut, Copy, Paste, Paste Selection Behind, Clear (Backspace), Shift Left, Shift Right, Reformat 
  1335. Selection, Replace, and Replace and Find Again.
  1336.  
  1337. Replace All and Revert are not undoable. All other “undoable” changes (such as changing the font) 
  1338. can be undone by reusing the same command (such as changing the font back).
  1339. To effectively make Replace All undoable, Save your document just before the Replace All. If you 
  1340. don’t want to keep the results, choose Revert to restore your document to the way it was before 
  1341. the replacement.
  1342.  
  1343. Just clicking the mouse or selecting a range of text does not affect undo. Changing the window 
  1344. does make the last change temporarily undoable, but you can restore the ability to undo the last 
  1345. change by bringing the appropriate window to the front again.
  1346.  
  1347.     Typing, Cut, Copy, Clear
  1348. “Typing” means hitting a sequence of keys that produces text, intermingled with any number of 
  1349. <Backspace>s. A new typing operation begins whenever you change the insertion point or select 
  1350. characters and then type something. As with all actions, just changing the insertion point or 
  1351. selecting characters does not affect your ability to undo—it’s the subsequent change to your text 
  1352. that does it.
  1353.  
  1354. When you type <Return> the resulting new line will have the same indentation as the line above it, 
  1355. unless you hold down the <Option> key, in which case you’ll end up flush at the left margin.
  1356. Clear has the same effect as the <Clear> key, and <Backspace> is also the equivalent of a Clear if 
  1357. a range of text is selected. If no text is selected, <Backspace> will delete one character, whereas 
  1358. Clear will not.
  1359.  
  1360.     Paste preserves indentation
  1361. At least, it does if the range of text you select to be pasted over, or the insertion point for the 
  1362. paste, satisfies the requirement: “all tabs or spaces to the left at the start”.
  1363. This means that the first character you select for replacement should be the first character on 
  1364. the line that is not a space or tab. If you have just an insertion point for the Paste, then the same 
  1365. applies—there should be nothing but spaces and tabs from the insertion point to the left margin. 
  1366. Starting at the left margin will also do.
  1367.  
  1368. The basic rule is you shouldn’t “see” any printing characters between the left margin and the 
  1369. start of your selection or insertion point. If this rule is satisfied when you are about to Paste, 
  1370. then the paste will preserve your relative indentation, removing the need to Shift Left or Shift 
  1371. Right afterwards.
  1372.  
  1373. About the only special action you should take to have Paste preserve your indentation is to open up 
  1374. a new line with a <Return> just before you paste in a block of code, which you probably do 
  1375. anyway.
  1376. Paste Selection Behind also preserves indentation.
  1377.  
  1378. One of the more obvious novelties of EnterAct is that it shows you what you have selected in the 
  1379. text window that is just behind the front window. This helps you to make use of the Paste 
  1380. Selection Behind command, and also shows you where you are when the Find dialog is in front of 
  1381. your text window.
  1382.  
  1383. The selection in your front window is shown in the standard way, namely white text in a black 
  1384. box. EnterAct draws a thick black outline around the selection in your next–to–front window so 
  1385. you can distinguish it from the front selection.
  1386. You’ll see the selection in your next–to–front window only when something can be done with it 
  1387. (such as Paste Selection Behind, or Replace). 
  1388.  
  1389.     Paste Selection Behind
  1390. This one is really great, entertains the kids for hours.
  1391. Paste Selection Behind does the following three actions in one : Copy what is selected in the front 
  1392. window; switch to the window just behind it; and Paste the copy in over the selection in that 
  1393. window. You’ll see your selection in the next–to–front window just beforehand, as described 
  1394. above. If you can’t see what is selected in the next–to–front window, you can either trust to 
  1395. memory (it’s undoable) or do a “manual” Copy, switch windows, Paste.
  1396.  
  1397. Paste Selection Behind is especially handy when switching back and forth between your working 
  1398. text window and a lookup window, but it can be used with any two text windows.
  1399. Your indentation will be preserved with Paste Selection Behind under the same circumstances that 
  1400. apply to a Paste (see “Paste preserves indentation” above).
  1401.  
  1402. If you want to undo a Paste Selection Behind but have switched to a different window, bring the 
  1403. two windows involved in the Paste Selection Behind to the front alternately until Undo becomes 
  1404. enabled. The two windows involved are the one you pasted into, and the one you copied from.
  1405.  
  1406.     Font, font size, tabs
  1407. Sizes for your font are restricted to sizes that are actually installed in your system. The default 
  1408. font for text windows in EnterAct is Monaco 9, with 4 spaces per tab.
  1409. You can also change the font for the project window. The default here is also Monaco 9. For 
  1410. projects only, holding down the <Option> key while changing the font or size will give you a bold 
  1411. style.
  1412.  
  1413. Tabs in EnterAct are of the relative sort, meaning that when you press <Tab> your insertion point 
  1414. advances to the next tab stop. Tab stops are placed a fixed number of spaces apart, and you can 
  1415. change this number with the Tabs dialog. Note that if you change the font it may throw off your 
  1416. nicely–aligned code, so it’s best to pick one font for code at the beginning of your programming 
  1417. career and stick with it.
  1418.  
  1419.     Shift Left / Right
  1420. Shift Left and Shift Right will shift one or more entire lines left or right by a tab stop, allowing 
  1421. you to repair or alter the relative indentation of your code or text. For simplicity, you should 
  1422. select one or more entire lines before calling these commands. They are undoable.
  1423.  
  1424.     Reformat Selection
  1425. This command has a very high entertainment/utility ratio. In other words, even if you never need 
  1426. it you’ll enjoy playing with it.
  1427.  Reformat Selection will rebreak the lines in your selection, but the result may not always be an 
  1428. improvement. It is designed to work with multiple paragraphs, provided you don’t indent the 
  1429. beginning of the first line, and that you separate paragraphs with a blank line.
  1430.  
  1431. Reformat Selection doesn’t work well on C code, although it may on occasion help to tidy up a 
  1432. complicated “if” statement. It works best with one or more paragraphs of text, either an entire 
  1433. comment or part of a comment, or paragraphs in a text document.
  1434.  
  1435. Since Reformat Selection is undoable there’s no harm in trying it. The maximum selection that can 
  1436. be reformatted at one time is roughly the standard Text Edit limit, 32,000 or so characters.
  1437. The specific reformatting that Reformat Selection does is governed by two options in the Options 
  1438. dialog. The default action is to rebreak lines with a “ragged right” format and a maximum line 
  1439. length of 74 characters, a nice width for printing Monaco 9. In the Options dialog (near the 
  1440. bottom) you can alter the maximum number of characters per line, and also select a “full 
  1441. justification” look if you want to knock people over with your comments. The maximum number of 
  1442. characters per line is restricted to a range of 30 to 150.
  1443.  
  1444.     Arrow keys for moving around
  1445. The up down left right arrow keys will move your cursor by one character or line. If you hold 
  1446. down the <Option> or <Command> key an arrow key will take you all the way in the appropriate 
  1447. direction. <Option><up arrow> and <Option><down arrow> are especially useful for taking you to 
  1448. the top or bottom of your document.
  1449.  
  1450.     Go to
  1451. The Go to Top and Go to Bottom menu commands do the same thing as <Option><up arrow> and
  1452. <Option><down arrow>, namely take you to the top or bottom of your document.
  1453.  
  1454. The Go to ... command is a cross between “go to line number...” and “open selection”. If you don’t
  1455. have a file name or line number selected in your front text window, Go to... will present you with
  1456. a dialog in which to enter a line number to jump to.
  1457.  
  1458. If you select a file name in your front window beforehand, Go to... will open the file by that name,
  1459. provided only that it is in your project. If you select a file name followed by a line number, as in
  1460. “FilesAndResources.c 400”, you will go to that file and line number. File name extension such as
  1461. “.c” or “.Notes” need not be selected, so if the main part of the file name is a single word with no
  1462. spaces you can just double–click on it before selecting Go to....
  1463.  
  1464. If your selection beforehand is not a pure number, and the text before the number is not a file
  1465. name, then you will be presented with the line number dialog—that is, arbitrary selections will
  1466. in most cases not fool EnterAct into jumping to a line before asking you which line you want.
  1467.  
  1468.     If there’s a problem
  1469. EnterAct has a single level of undo, and the window that the undo applies to must be in front in 
  1470. order for the Undo command to be enabled. 
  1471. To undo a Paste Selection Behind, the window pasted into must be in front, and the window copied 
  1472. from must be just beneath, the way EnterAct leaves them after carrying out the command. If you 
  1473. can remember which two windows were involved in the Paste Selection Behind, just bring them to 
  1474. the front alternately until the Undo is enabled.
  1475.  
  1476. If Paste doesn’t preserve your indentation, it’s because you’re leaving some text at the left of 
  1477. the first line unselected when you select a range or insertion point for the Paste. In particular, 
  1478. Paste won’t preserve indentation if you select an insertion point for the Paste that is to the right 
  1479. of the first visible character on the line (“visible character” here meaning something that is not a 
  1480. space or tab). While we’re on the subject, you can switch off the preservation of indentation for a 
  1481. Paste by typing a single character just before you Paste, and then deleting it after the Paste.
  1482.     
  1483. ----------------------------------------------------------
  1484. Balance
  1485. ----------------------------------------------------------
  1486.  
  1487.     Checks everything
  1488. ...except those angular brackets that you find only in
  1489.         #include <SystemHeader.h>.
  1490. The full list is (), [], {}, /* */, " ", and ' '.
  1491. Balance will also detect nested comments and any single improperly–formed comment start or 
  1492. end. Two improper comment delimiters in a row (improper start followed by improper end, or 
  1493. vice versa) will not be detected, but that’s a one–in–a–million case that you’ll probably never see. 
  1494.  
  1495. Because Balance detects nested comments, it will signal an error if you use a comment start or end
  1496. within a comment (nested comment starts are excepted if you deselect the “Detect nested comment
  1497. starts” option)—see “Nested and bad comments” below.
  1498.  
  1499. For strings in double quotes " ", the line continuation character '\' must be the last character on 
  1500. the line if the string is continued to the next line:
  1501.     "This string is \<Return>
  1502.     properly continued."
  1503.     "This string will trigger<Return>
  1504.     a Balance error."
  1505.     "So will \<space><Return>
  1506.     this string, due to the space before Return."
  1507. Balance will behave in different ways depending on where you are in the code. To Balance an entire 
  1508. file, select an insertion point at the very top of the file (<Option><up arrow> will take you there). 
  1509. To Balance a specific delimiter, either click just to the left of it or select the delimiter (note for 
  1510. comment starts and ends this means both characters). 
  1511.  
  1512. Given an insertion point, Balance will first look to the immediate right for a delimiter that wants 
  1513. balancing, and then to the immediate left. When several delimiters are side by side, you can avoid 
  1514. having to remember this by just selecting the delimiter you wish balanced. Clicking between the 
  1515. characters of a comment start or end also counts as a “hint” to find the other end. 
  1516. If your range of characters selected doesn’t consist of just a single delimiter, or if your insertion 
  1517. point is not right next to a delimiter, then Balance will try to find the smallest enclosing pair of 
  1518. delimiters. Your selection range will expand to the next enclosing pair as you repeat the Balance 
  1519. command.
  1520.  
  1521.     Shows the error location
  1522. Any unmatched or mismatched delimiter will be selected and shown. In the case of mismatched 
  1523. delimiters, you can switch between the two delimiters by selecting Balance again. If the delimiter 
  1524. is an “orphan”, the second Balance will just produce a beep, since there’s no other end to show.
  1525.  
  1526.     Balancing a file
  1527. Given an insertion point at the top of a file, Balance will balance the entire file. If you hear a beep 
  1528. and the cursor does not move from the top of the file, that means the entire file is balanced. Either 
  1529. Go Top or <Option><up arrow> will take you to the top of a file.
  1530.  
  1531. Balancing a file by starting from the top will always work correctly. You can also Balance a file 
  1532. by starting at the very bottom, but this may not work properly if the file contains any 
  1533. assembly–language sections (see “The asm problem” at the end of this chapter).
  1534.  
  1535.     Balancing a specific delimiter
  1536. Balance looks for a “hint” from you, as indicated by your insertion point or selection, before 
  1537. going ahead. As mentioned above, you can Balance one specific delimiter by selecting it just before 
  1538. the balance, or by selecting an insertion point just to the left of it. If the delimiter is not next to 
  1539. another delimiter, you can click on either side of it. With comments and strings it is best to start 
  1540. the Balance off with a “hint”, that is, select one end of the comment or string or click next to one 
  1541. end, since if you start in the middle of a comment or string the text will be checked as strictly as 
  1542. possible, without allowance for it being within a comment or string.
  1543.  
  1544.     Nested and bad comments
  1545. Balance will detect all nested comments, and any comment that has one end missing. In the case of 
  1546. a comment with one end missing , you will be shown a “good” end in the vicinity of the bad one, 
  1547. and you’ll have to deduce on your own where the other end should be. Comment errors can 
  1548. sometimes be subtle and difficult to see, such as a space between the '*' and the '/'.
  1549.  
  1550. You may find it worthwhile to Balance all your source files with EnterAct’s balance command, 
  1551. since comment errors can sometimes slip past THINK C’s compiler, resulting in some of your code 
  1552. being quietly treated as though it was commented out. This can have unpleasant consequences—if 
  1553. you’re not lucky, it can generate a wild pointer. Note that any files in your EnterAct project are 
  1554. guaranteed to be free of these comment errors after a successful Update Dictionary, since the 
  1555. dictionary–builder checks comments thoroughly.
  1556.  
  1557. The one price to be paid for EnterAct’s improved comment checking is that you should not use a 
  1558. comment start or end within a comment. Such things as
  1559.     /*.../*...*/
  1560. and
  1561.     /*...*/...*/
  1562. will be treated as errors, both by the Balance command and by the dictionary–builder. If you do 
  1563. need to use a comment start or end within a comment, the general cure is to place some character 
  1564. between the star and the slash. A space will do, or you could be pedantic and place each character 
  1565. in separate single quotes, for example instead of /* use / * or '/''*'. 
  1566.  
  1567. Well, OK—some of you deliberately double up your comment starts to save on typing. If you do this,
  1568. select the Options command under the Edit menu and uncheck the “Detect nested comment starts” 
  1569. check box. This affects the dictionary builder also.
  1570.  
  1571.     Starting in the middle
  1572. If your selection doesn’t indicate a hint, Balance first looks backwards in your file for a delimiter; 
  1573. when it finds one, it then looks forwards for another delimiter, hoping to match them up. Of 
  1574. course, if you supply an opening delimiter as a “hint”, or start from the top of the file, Balance 
  1575. will proceed in the forward direction immediately.
  1576.  
  1577. On rare occasions you may wish to balance the contents of a comment or string as though it were 
  1578. code, and not just text. To do this, click or select a range of characters within the comment or 
  1579. string, away from either end. Balance will then check all delimiters as it works outwards, until it 
  1580. encounters one end of the comment or string and “realizes” that it has been fooled. 
  1581. By the way, EnterAct also accepts “C++” style comments, as in
  1582.     //comment beginning with two slashes, to end of line
  1583. but only to the extent of skipping over the contents when balancing. If you start the Balance within 
  1584. this sort of comment it will be treated as code rather than text, just as with ordinary comments. 
  1585.  
  1586.     Diagnosing a problem
  1587. When you Balance an entire file, you will hear a beep whether or not the file balanced, just to tell 
  1588. you that the balancing is finished. If the cursor doesn’t move from the top of the file, that means 
  1589. the entire file is balanced. If there is any error in the file, you will be shown the first unbalanced 
  1590. delimiter.
  1591.  
  1592. When balancing just part of a file, you will hear a beep only if there is an error. Otherwise, the 
  1593. selection range will quietly expand to the next largest balanced range. If there is no larger 
  1594. enclosing range (this is the case when you start with an entire function body selected, for 
  1595. example) you’ll hear a beep but the selection range will not change.
  1596.  
  1597. With the exception of strings, only two types of balance errors can occur; mismatched ends, and 
  1598. missing ends. If Balance beeps and shows you an unbalanced delimiter, try immediately selecting 
  1599. Balance again. Then, if the problem is due to mismatched delimiters, you will be shown the other 
  1600. end. If the problem is a missing end, nothing new will happen—you’ll hear another beep, but the 
  1601. selected delimiter will not change.
  1602.  
  1603. Strings in double quotes " " are checked for one additional special error, a missing backslash if the 
  1604. string is continued across lines. The backslash must be the very last character on the continued 
  1605. line, just before the <Return>—note that even a space before the <Return> will “hide” the 
  1606. backslash. Personally, I don’t think this is reasonable, but that’s the way C is.
  1607.  
  1608.     The asm problem
  1609. If Balance runs into an “asm {...}” construction while looking backwards through your code, it 
  1610. just plain won’t know that it’s inside an asm. Any error you’re shown in this one circumstance is 
  1611. not to be trusted, since it will almost certainly be due to a delimiter inside an assembly–language 
  1612. comment (they start with a semicolon). 
  1613.  
  1614. When you balance a file from the top, all asm constructions will be handled properly. The 
  1615. dictionary–builder, by the way, also handles asm’s properly. Be warned that in other cases if you 
  1616. ask Balance to run backwards through a block of assembly language it will hiccup if it runs into a 
  1617. delimiter within an assembly–language comment. This is a bug, but I haven’t found a cure that 
  1618. wouldn’t slow balancing down to a crawl. 
  1619.  
  1620. Because of this problem it is best to always balance an entire file by starting from the top rather 
  1621. than from the bottom, unless you’re sure that the file contains no assembly–language.
  1622. To Balance an assembly–language block, or a function containing assembly–language, select or 
  1623. click next to the opening curly brace '{' at the top rather than the closing curly brace.
  1624. Otherwise, this will only be a problem if you’re balancing inside a function that contains a block of 
  1625. assembly–language. Then, you should select opening delimiters rather than closing delimiters 
  1626. before balancing. 
  1627.     
  1628. ----------------------------------------------------------
  1629. Search
  1630. ----------------------------------------------------------
  1631.     Introduction
  1632. Single and multi–file searches in EnterAct are controlled by a modeless Find dialog. The one 
  1633. important novelty is that you fine–tune your multi–file selection by holding down the <Option> key 
  1634. and dragging over the files in the project window (bullets • appear beside each file included in the 
  1635. search).
  1636. Replace, Replace and Find Again, and Replace All are all undoable.
  1637.  
  1638.     Find is modeless
  1639. This requires a few minor adjustments in the way you search. 
  1640. There is no Cancel button in the Find dialog box—it has a Close box instead. 
  1641. While the Find dialog is the front window, search commands that deal with single files will apply to 
  1642. the window just beneath the Find dialog. Replace All is excepted because it can cause multiple 
  1643. changes, so to use this command you must have the text window in front.
  1644.  
  1645. The “Find” button is the equivalent of the Find Again command. When you click the Find button or 
  1646. select Find Again, the window just beneath the Find dialog will be brought to the front, and the 
  1647. next instance of your find string shown. The Find dialog will stay on–screen, moving just behind 
  1648. the window being searched, so to find again you can if you wish leave your mouse stationed over 
  1649. the Find button and double–click (not a true double–click, the first click brings the Find dialog to 
  1650. the front, and the second does the Find Again).
  1651.  
  1652. Buttons for multi–file searching are incorporated directly in the Find dialog. To modify your 
  1653. multi–file search selection of files, hold down the <Option> key and drag over the file names in the 
  1654. project window. You’ll see the “eyeball” cursor while doing this.
  1655.  
  1656.     Find options
  1657. Select “Match Words” if  you don’t wish to match a longer string that contains your find string in 
  1658. a form that makes a different word. For example, the string “Open” will also match “Opening”, 
  1659. “Opened” etc unless you select the “Match Words” option in the Find dialog.
  1660. A special case: if your string begins or ends with puncuation, such as “->structMember” then 
  1661. leave “Match Words” unselected.
  1662. “Wrap Around” will continue your search from the beginning of your document if the next Find 
  1663. runs off the bottom end of it. 
  1664.  
  1665. This also affects the Replace commands: to Replace All instances in a file, it’s simplest to select 
  1666. an insertion point at the top of the file beforehand; to Replace All instances below a certain point, 
  1667. click just before the position where you want the replacing to start, and leave “Wrap Around” 
  1668. deselected.
  1669. “Ignore Case” treats upper and lower–case letters as the same.
  1670.  
  1671.     <Tab> and <Return>
  1672. A plain <Tab> will jump your cursor from one edit field to the other, and a plain <Return> is the 
  1673. equivalent of the “Find” button. To enter a <Tab> or <Return> in either the find or the replace 
  1674. text, hold down the <Command> key while typing the character.
  1675.  
  1676.     Find again
  1677. This menu command is the equivalent of the “Find” button in the Find dialog, and finds the next 
  1678. instance of your find string in accordance with your Find options (see above). Find Again searches 
  1679. the front window, or, if the Find dialog is in front, the window just behind the Find dialog.
  1680.  
  1681.     Enter selection
  1682. Enter Selection will replace your current find string with whatever text you have selected. It 
  1683. works with any text window including lookup windows, and also the project window (in case you 
  1684. wish to search for a file name). If your Find dialog is on–screen, you will see the new find string 
  1685. in the dialog.
  1686.  
  1687.     Recent finds are remembered
  1688. Your most–recent find strings will be stored in the popup “Find:” menu at top–left of the Find 
  1689. dialog. Selecting an item from the popup will copy it to your find string box.
  1690. Two minor limitations apply: find strings containing <Return>s or more than 48 characters will 
  1691. not be remembered by the popup menu.
  1692.  
  1693.     Replace
  1694. Replace can be thought of as a Paste for short strings (up to 255 characters). The replacement 
  1695. text is taken from the replace string in the Find dialog. No checking is done to see if the selection 
  1696. that will be replaced corresponds to your find string, so the replacement string can in effect be 
  1697. used as a second (small) clipboard. To set up a choice between two “Paste” alternatives, enter 
  1698. one selection into the replacement string in the Find dialog, and then Copy the other selection. Then 
  1699. Paste or Replace in your document as appropriate.
  1700.  
  1701. If the Find dialog is in front, Replace will affect the window just behind the Find dialog.
  1702. Replace is undoable provided the window in which the Replace was done is in front, and provided 
  1703. you don’t perform some other undoable action before undoing.
  1704.  
  1705.     Replace and Find Again
  1706. This command is the exact equivalent of Replace followed by Find Again, and is undoable.
  1707.  
  1708.     Replace All
  1709. Unlike other search commands, Replace All cannot be called when the Find dialog is in front—you
  1710. must specifically bring frontmost the window in which you wish to use Replace All. This small
  1711. awkwardness is an attempt to remind you that Replace All is the one editing command that can
  1712. make a real mess of your document. However, it is undoable—as with other undoable operations,
  1713. you need only have the correct window in front before undoing.
  1714.  
  1715. If you have selected the “Wrap Around” option in the Find dialog, Replace All will indeed replace 
  1716. all instances of the find string with the replace string throughout your document. If “Wrap 
  1717. Around” is not checked, replacement will be done only below your current position in the text. To 
  1718. prevent a single instance of the find pattern from being replaced, select at least the first 
  1719. character of the instance in your document just before Replace All (selecting all of it will do).
  1720.  
  1721.     Multi–file searches
  1722. Any file in your project can be added to a list of files to be searched. Files that are included in a 
  1723. multi–file search will have a bullet • just to the left of the name in the project window.
  1724. “Coarse” setup of the multi–file search is done with the small buttons in the lower–right of the 
  1725. Find dialog. These allow you to select all files of a particular type—.c, ".h", <.h>, or plain text. 
  1726. The “None” button will clear the multi–file search selection, and the “All” button will add all of 
  1727. your project text files to the list. A counter in the Find dialog shows how many files will be 
  1728. searched.
  1729.  
  1730. To “fine–tune” your list of files to be searched, hold down the <Option> key and click on or drag 
  1731. over the files in the project window. The cursor will change to an eye, and bullets beside the file 
  1732. names will appear or disappear as you drag up and down over the files. There is an illustration of 
  1733. this near the beginning of this chapter.
  1734.  
  1735. Once your files are selected (and you’ve entered what you want found in the find string in the Find 
  1736. dialog) select Find In Next File or click the equivalent button in the Find dialog. As the search 
  1737. progresses, you will see the bullets beside file names in the project window disappear as each file 
  1738. is searched. The counter in the Find dialog will also count down the number of files remaining. If an 
  1739. open file is searched by Find In Next File, it will be searched from the beginning of the file. When 
  1740. an instance is found, Find Again will locate other instances in the same file. To continue the 
  1741. multi–file search with the next  file, select Find In Next File again.When all files have been 
  1742. searched, you’ll hear a beep, the counter in the Find dialog will read zero, and all bullets will be 
  1743. gone from the project window.
  1744.  
  1745. Even if you don’t find anything, it puts on a nice show.
  1746. A <Command><period> will interrupt a multi–file search, and also clear the list of files to be 
  1747. searched.
  1748.  
  1749.     Markers and Automark
  1750. A “marker” is a marked location in your text consisting of a start point, an end point, and a name 
  1751. to be associated with the marked position. To place a marker, select either an insertion point or 
  1752. the range of text that you want remembered, and then select the Mark command. You will be asked 
  1753. to supply a name for the marker: click OK, and then forever after you will be able to jump to that 
  1754. marker whenever you want (marks are saved to disk and properly maintained).
  1755.  
  1756. To jump to a marker, hold down either the <Option> or <Command> key or both and click-and-hold 
  1757. in the title bar of your window. You’ll see a popup menu listing all of the markers attached to your 
  1758. file. Pick one, and you go there. The markers are in alphabetical order.
  1759.  
  1760. Markers do stay attached to the proper position as you edit the file around them, but any editing 
  1761. that’s done inside the marked range will correspondingly expand or shrink the range associated 
  1762. with the marker. If you remove all of the text that is within the marked range, you will also 
  1763. remove the marker, and this is not undoable. Markers do not survive cutting or pasting—they stay 
  1764. attached to the text only as long as the text remains in the document. 
  1765.  
  1766. To remove one or more markers, select Unmark. You will be presented with a list of markers to 
  1767. select for deletion. This list follows the standard Macintosh rules for list selection: click with no 
  1768. keys held down to select a single marker (this deselects any other selected markers); click with 
  1769. the <Shift> key down to select a contiguous range of markers while dragging the mouse; and click 
  1770. with the <Command> key held down to select a marker that is away from other selected markers 
  1771. (the markers in between are left unselected). 
  1772.  
  1773. Mind you, adding markers to a file for the first time can be tedious. So pick Automark from the 
  1774. “Search” menu instead, and let EnterAct do the work:
  1775.  
  1776. This command works with any C file, whether or not it has been added to your project. If you wish 
  1777. to keep special markers that you have manually added, leave “Clear all present markers first” 
  1778. without a check mark. When a duplicate name or position is found while adding markers, the new 
  1779. entry will replace the old one.
  1780.  
  1781. The “first of group only” checks have slightly different interpretations: for #defines, it means 
  1782. mark only the first of a group of consecutive #defines; for enum constants, it means mark only 
  1783. the first within an enum {} statement; and for variables it means mark the first of a group of 
  1784. consecutive variables, whether they occur in the same statement or in separate statements. If 
  1785. you leave some types unselected then EnterAct’s automarker won’t count them as separating, 
  1786. say, two groups of variables or #defines.
  1787.  
  1788. To keep things sane, there is a limit of 499 marks to a file. This is a 9 foot popup menu, a bit 
  1789. tedious to scroll through even with a 68050. Marker names are limited to 63 characters, but the 
  1790. range of text you mark with the name can be as long as you want.
  1791.  
  1792. PLEASE NOTE your markers will be maintained properly only by editors that implement
  1793. MPW–compatible marks. In particular, if you edit a marked file with THINK C
  1794. version 4 or earlier, your marks will be thrown off. However, if you use Automark to
  1795. set all of your marks, then re–marking a file after editing it with such an editor will
  1796. be relatively painless—just use Automark again with your preferred options checked,
  1797. and check “Clear all present markers first”.
  1798.  
  1799. ----------------------------------------------------------
  1800. Documents and windows
  1801. ----------------------------------------------------------
  1802.  
  1803.     New, Open, Close
  1804. New under the File menu means a new text window. To create a project, select New Project from 
  1805. the EnterAct menu. A new lookup window appears automatically whenever you look something up. 
  1806. New PICT windows can’t be had, no matter what you try.
  1807.  
  1808. Open under the file menu allows you to open any TEXT or PICT document. To open a project, select 
  1809. Open Project from the EnterAct menu. 
  1810.  
  1811. Close will close the front window, whatever it is, and the key equivalent <Command><J> is often 
  1812. handy. Close Project will close the project window whether it is in front or not. Only one project 
  1813. can be open at a time, so if you select Open Project while a project is open you will be asked to 
  1814. confirm putting away the current project. The same applies if you select New Project.
  1815. To close all text windows, select Close All from the Windows menu. This will not close your 
  1816. project or the Find dialog.
  1817.  
  1818.     Save, Save As, Revert
  1819. Save applies only to proper text documents (not lookup windows) and to PICT’s. Saving a PICT will 
  1820. alter only the window location that EnterAct saves with any file. To save the contents of a lookup 
  1821. window, Copy what you want and Paste it into a regular text window. Projects are saved 
  1822. automatically, when you update the dictionary, add files, or close the project. 
  1823.  
  1824. Save As can be used with text and PICT documents, and with a project as well. In particular, you 
  1825. can set up a project to use as “stationery”, with the font and window location preset, and 
  1826. commonly needed files already added.
  1827. Revert applies to text and PICT documents only.
  1828.  
  1829.     Saving window locations
  1830. Saving window locations is nice, provided you aren’t pestered all the time to save your changed 
  1831. location when you close a window. In EnterAct, saving window locations takes the place of neatly 
  1832. tiling and stacking windows. By default, EnterAct will save window locations whenever you save a 
  1833. text or PICT document. If you would rather not have window locations saved, call up the Options 
  1834. dialog and uncheck the “Save document window locations” item. Any saved locations will also be 
  1835. ignored when a document is opened if you uncheck this item.
  1836.  
  1837.     ... without being pestered
  1838. Beneath the “Save document window locations” item in the Options dialog there’s another check 
  1839. box, “...but don’t pester me about saving locations”. Both of these options are on by default. The 
  1840. “don’t pester” part means that you will not be asked if you wish to save a text window when you 
  1841. close it if all you’ve done is change the window’s location on the screen. 
  1842. The location of the project window is always saved (this is automatic) regardless of your options.
  1843.  
  1844.     Newly opened windows can be long or short
  1845. If the “Save document window locations” item in the Options dialog has a check mark, and if a 
  1846. document you open has a window location saved with it, then EnterAct will restore your document 
  1847. to its saved location. Otherwise, EnterAct won’t have a remembered location for the window, or 
  1848. will ignore it (this is especially true of a new text window). You can roughly control the length of 
  1849. these windows with the radio button options “Windows open short / long by default” in the 
  1850. Options dialog. Long windows will reach all the way to the bottom of your main screen when they 
  1851. open. Short windows will indeed be relatively short on a large screen, but will fill most of a small 
  1852. screen.
  1853.  
  1854. The default is short windows. Note that you can grow just the length of any text window down to 
  1855. the bottom of the screen by holding down the <Option> key while clicking in the zoom box.
  1856. The default width of a window is fixed at a moderate size, about 74 characters in Monaco 9. This 
  1857. is also a near–maximum nice width for printing. If you ever wish to reset a window to this 
  1858. nice–for–printing width: Save your document; uncheck the “Save document window locations” 
  1859. item in the Options dialog; alter your document by typing something; and then Revert the document 
  1860. to the saved form. OK, OK, this is a kludge, but it’s better than nothing.
  1861.  
  1862.     <Option>–Zoom zooms just the length
  1863. If you hold down the <Option> key while clicking in the zoom box of a window, only the length will 
  1864. be affected. If you’re zooming out (the first zoom is usually an “out”), the bottom of the window 
  1865. will drop down to the bottom of your screen, rather in the way a menu drops down. Zooming in is 
  1866. not affected by the <Option> key. 
  1867.  
  1868. (Tech Note: the length will actually grow to the bottom of the shortest screen that the window 
  1869. touches. Much gray hair here until I tried the “cookie–cutter” approach: get the gray region, and 
  1870. stamp alternate window sizes out of it using SectRgn or UnionRgn.)
  1871.  
  1872.     Number of windows at one time
  1873. EnterAct has fixed limits on the maximum number of windows on–screen at one time, as follows:
  1874. regular text    20
  1875. lookup            10
  1876. PICT                4
  1877. project        1.
  1878. If you find any of these limits (except the project limit) restrictive, please let me know. There is 
  1879. one circumstance in which the text window limit does not apply: you can print any number of 
  1880. EnterAct  text files by selecting them in the Finder and then selecting the Finder’s print command.
  1881. While the hard upper limit on lookup windows is 10, you can set the maximum number on–screen 
  1882. to any number between 1 and 10 using the Options dialog. The default number is 4.
  1883.  
  1884.     The Windows menu
  1885. Consisting of: Close All, Save All, Keep Lookup Around, and “bring a window to the front”.
  1886. Close All affects text, lookup, and PICT windows. If it needs saving, you’ll be asked. Lookup 
  1887. windows will be quietly closed, since they cannot be saved. The combination of Close All with 
  1888. remembered window locations lets you arrange groups of documents to work with at one time, and 
  1889. switch between groups with a minimum of nuisance.
  1890.  
  1891. Save All will save any text or PICT documents that need it (note lookup windows aren’t saveable). 
  1892. If a text window hasn’t been saved yet, you’ll see the standard Save As dialog. If you use 
  1893. MultiFinder, and you decide to switch off the “Safe switching under MultiFinder” option in the 
  1894. Options dialog, I would strongly recommend that you use Save All or preferably Close All before 
  1895. switching to another application.
  1896.  
  1897. Keep Lookup Around applies only to lookup windows. The maximum number of lookup windows 
  1898. on–screen is fixed (although you can change this number at any time in the Options dialog), and 
  1899. when this limit is reached the next lookup window that you call up will quietly close one of the old 
  1900. lookup windows to make room. To avoid having a particular lookup window disappear later on you, 
  1901. select Keep Lookup Around when the lookup window is in front. The two bullets •• at the beginning 
  1902. of the lookup window’s title will change to ¶¶, showing that it won’t go away until you yourself 
  1903. close it. Note especially that Close All will close all lookup windows, whether or not they are 
  1904. marked for keeping.
  1905.  
  1906. To bring a window to the front, select it by name from the lower part of the Windows menu. If a 
  1907. project is open, it can always be brought to the front with the menu key–equivalent 
  1908. <Command><zero>, which is worth memorising. No other windows (except dialogs) have key 
  1909. equivalents—if your memory is that good then in my humble opinion you don’t need EnterAct in the 
  1910. first place. 
  1911.  
  1912.     The display box
  1913. All text windows including lookup windows have a small “display box” along the bottom in the 
  1914. horizontal scroll bar area. For a regular text file this displays the name of the file; in a lookup 
  1915. window it shows the name of the file from which the entry was taken, followed by the 
  1916. (abbreviated) type of entry, the number of the current entry shown, and the total number of 
  1917. entries available in the lookup window.
  1918.  
  1919. When you drag the mouse to select text in a text window, the display box will change to show the
  1920. line number that the mouse is currently on, followed by the number of characters selected. If
  1921. more than one line is selected, the display box will show the number of lines selected rather than
  1922. the current line number. To determine how many lines there are in a file, use <Option><down
  1923. arrow> or Go Bottom and click on the last line of the file. To determine the number of characters
  1924. in a file, click at one end of the file and then <Shift>click at the other end of the file.
  1925.  
  1926.     Printing
  1927. To print a text file, bring its window to the front and select Print. A Page Setup beforehand will 
  1928. be needed if you wish to print in a nonstandard way, such as sideways or with an unusual paper 
  1929. size. To stop a printout, press <Command><period>.
  1930.  
  1931. Printing of PICT’s or other kinds of files is not supported, just text.
  1932. EnterAct does not clip long lines, but folds the “hangover” back to the left margin on a new line. 
  1933. The line-break is not always as good as you yourself would do it, but at least you will never lose 
  1934. any characters off the right edge when printing. 
  1935.     
  1936. ----------------------------------------------------------
  1937. Options, under the Edit menu
  1938. ----------------------------------------------------------
  1939.  
  1940.     Introduction
  1941. You can change any of the options at any time. Defaults for the options are shown in the figure 
  1942. above, and have been selected to give best performance under average conditions. Options are 
  1943. saved with EnterAct itself rather than a project. Some of them you’ll set once and forget, but the 
  1944. number of lookup windows and the number of entries per lookup determine how cluttered your 
  1945. screen can get, and how many alternate entries a lookup window will hold, so you’ll vary these 
  1946. two numbers to suit particular circumstances.
  1947. For a discussion of “Safe switching under MultiFinder” please see the next chapter, “Switching 
  1948. to other applications”.
  1949.  
  1950.     Number of lookup windows
  1951. This box allows you to set the maximum number of lookup windows that can appear on–screen at 
  1952. one time. For complicated situations you may want more than 4, whereas on a small screen you 
  1953. may prefer fewer than 4 to avoid clutter.
  1954.  
  1955.     Number of entries per lookup window
  1956. The number in this box determines how may dictionary entries will be retrieved in a lookup 
  1957. window, if your spelling does not match any term in the dictionary exactly. If your spelling does 
  1958. match a term exactly, all exact matches will be retrieved, up to a maximum of 60. You may wish 
  1959. to temporarily increase the number in this box if your recollection of the spelling of a term is 
  1960. shaky. On a regular basis, you may prefer 3 or 5 entries rather than 4—a bit of experience will 
  1961. tell.
  1962.  
  1963.     Remembering window locations
  1964. By default, EnterAct will remember the window locations of all your documents (saved in a small 
  1965. resource with the document). Also, you will not be asked if you want to save changes to a 
  1966. document when you close it if the only change is a change in window location (the “don’t pester” 
  1967. option). You can take advantage of the remembered window locations to work with groups of 
  1968. documents; arrange each group nicely on the screen, and then if you later reopen the documents in 
  1969. that group they will be arranged on–screen where you left them.
  1970.  
  1971.     Long or short windows
  1972. If there is no remembered location for a document, or if you have switched off the “Save 
  1973. document window locations” option, then a newly–opened window will come up near the top of 
  1974. your screen, with a relatively short or long length according to what you select in the option 
  1975. “Windows open short/long by default”. You may not notice much of a distinction if you have a 
  1976. small screen. This short/long option always governs the appearance of new text windows, and of 
  1977. text files created by other applications that have never been saved while using EnterAct.
  1978.  
  1979.     Reformat Selection options
  1980. Reformat Selection will rebreak the lines in a selection of text to improve the appearance of the 
  1981. right margin. Aside from selecting a “ragged right” or “full justification” look, you can also set 
  1982. the maximum number of characters per line in the “Reformat line width” box. The default of 74 
  1983. gives a long but printable line in Monaco 9.
  1984.  
  1985.     Detect nested comment starts
  1986. This option is on by default, meaning that EnterAct will accurately trap any single failure to properly
  1987. start or end a comment, both while building your dictionary and while balancing. If you are in the
  1988. habit of doubling up on comment starts, as in
  1989. /*#define Flag37 /* if defined, use SlowDraw */
  1990. and if you are not willing to mend your ways, uncheck this option: comment starts within a comment
  1991. will then be ignored for dictionary and balance purposes. Just make sure you type carefully!
  1992.     
  1993. ----------------------------------------------------------
  1994. Switching to other applications
  1995. ----------------------------------------------------------
  1996.  
  1997.     Under the Finder
  1998. There are some nifty INIT’s that will let you switch between applications under the Finder almost 
  1999. as quickly and easily as if you were using MultiFinder—On Cue and Master Juggler come to mind. 
  2000.  
  2001. Whatever means you employ to switch to another application from EnterAct while under the 
  2002. Finder, you will be asked if you wish to save any documents that need saving, and they will all be 
  2003. closed. The situation with MultiFinder is different , since documents can be left open when 
  2004. switching to another application.
  2005.  
  2006.     Under MultiFinder
  2007. If you switch from EnterAct to some other application while under MultiFinder, you will not be 
  2008. required to close your documents. This means that while using the other application you could 
  2009. attempt to access documents that you have left open in EnterAct. If this potential conflict weren’t 
  2010. handled, you could end up working with two different versions of the same document, and 
  2011. inevitably you would lose one version.
  2012.  
  2013. One solution to this problem would be to prevent you from opening that document with any other 
  2014. application if it is left open in EnterAct. This restrictive “my file and you can’t have it” attitude 
  2015. is appropriate if an application is meant for use on a network, where several people could want 
  2016. access to the same file at once.
  2017.  
  2018. However, EnterAct is not meant to be used on a network, so it does not take this approach. 
  2019. Instead, when you switch, all open documents are quietly saved if they need saving and have ever 
  2020. been saved before (“untitled” documents present no problem—you can’t get at them with another 
  2021. application). In addition, when you return to EnterAct, EnterAct will check your disk to see if you 
  2022. have altered any of the open documents while you were away—if so, they will be quietly reloaded. 
  2023. EnterAct, if effect, opts for the “low man on the totem pole” position when it comes to having 
  2024. control over file access, and does the necessary behind–the –scenes work to allow you to leave 
  2025. files open and still be able to open and change them with other applications.
  2026. To make this bulletproof, it will be safest if you close all text documents when leaving the other 
  2027. application, since that other application will typically not be able to compensate for files being 
  2028. changed “behind its back” in EnterAct.
  2029.  
  2030. You can, if you wish, defeat this protection by unchecking the “Safe switching under MultiFinder” 
  2031. option in the Options dialog. However, EnterAct will not restrict access to open files when you 
  2032. switch, so you will be entirely responsible for ensuring that you don’t end up with two versions of 
  2033. the same file floating around. Closing all open text documents before switching would be sufficient.
  2034.  
  2035. Safe switching protection can also be defeated on a per–switch basis, by holding down any of the
  2036. <Shift>, <Option>, or <Command> modifier keys while you switch. Holding down a modifier key
  2037. while you switch out from EnterAct means that unsaved changes to files will be left unsaved, and
  2038. when you return to EnterAct any files open in EnterAct that were changed elsewhere will not be
  2039. updated for you on–screen. Holding down a modifier key while returning to EnterAct will prevent
  2040. just the updating on–screen of any files that were changed elsewhere—this is, on rare occasions,
  2041. handy if you change a file with some other application, realise you’ve made a mistake bu can’t
  2042. revert, and wish to recover the version of you file that’s still open in EnterAct.
  2043.  
  2044.     Check the disk for changes
  2045. When you edit source (.c or .h) files that are in an EnterAct project with some other application, 
  2046. select Update Dictionary From Disk when you reopen the project to ensure that your dictionary is 
  2047. brought up to date, unless you clearly recollect that you didn’t change anything outside of a 
  2048. function body. This update typically takes only a few seconds.
  2049. Only the project you have open will track which files are changed, so if you switch to a different 
  2050. project you will also need to select Update Dictionary From Disk to rebuild the dictionary if any .c 
  2051. or .h files in the project were changed while the project was not open, whether or not the files 
  2052. were changed with EnterAct.
  2053.  
  2054. Conversely, when you switch to THINK C after a session of editing with EnterAct, select THINK 
  2055. C’s Make command and click the “Use Disk” button followed by the “Make” button to bring your 
  2056. THINK C project up to date. This may add 10 or 20 seconds to the recompile that you will have to 
  2057. do anyway after editing source files. If you remember exactly which files were changed, you can 
  2058. instead select them one by one in the project window and use the “Compile” command to update 
  2059. your THINK C project.
  2060.  
  2061. Other applications that employ a project concept involving source files may also require that you 
  2062. issue some sort of check–the–disk command to bring things up to date.
  2063.     
  2064. ----------------------------------------------------------
  2065. Lookup tips
  2066. ----------------------------------------------------------
  2067.  
  2068.     Looking up your notes
  2069. Here’s how to build your own hard–won notes and observations about programming the Macintosh 
  2070. into your dictionary, for quick retrieval by name.
  2071.  
  2072. Note files consist of fake structs, the sole content of each struct being a comment which contains 
  2073. the specific note. Suppose, for example, one of your notes concerns getting and using the 
  2074. modification date (“modDate”) for a file. To be able to retrieve the note, you first need to give it 
  2075. a memorable name, such as “modDateNote”. Then, in your note file, you would set up the 
  2076. dictionary entry like this:
  2077.     struct modDateNote
  2078.         {
  2079.         /*
  2080.         Paste the note in here, within a comment
  2081.         that makes up the entire "struct" body.
  2082.         */
  2083.         }; /* actually, the semicolon is optional */
  2084. The note goes inside a comment, which makes up the body of a struct. Placing the note inside a 
  2085. comment is necessary, because the dictionary–builder checks for proper balance of some 
  2086. delimiters within the body of a struct.
  2087.  
  2088. It remains only to persuade EnterAct to build such a file into your dictionary. EnterAct will do so 
  2089. for files that are in the left or middle pane of your project, and by default if a file name ends in 
  2090. “.c” or “.h” it is added to the left or middle pane respectively. However, a slightly nicer 
  2091. approach is to give your note files an ending that describes what they are. A reasonable choice 
  2092. would be “Notes”, and then your note files would have names like “File.Notes”, 
  2093. “Memory.Notes”, “DA.Notes”. To instruct EnterAct that files with names ending in “Notes” 
  2094. should go in the left or middle pane, the last step is to select the File Extensions command and type 
  2095. in the file extension (eg “Notes”) that you choose for your note files—see the “Custom file 
  2096. extensions” section on page 28 for an example. Which pane these files go in (left or middle) is up 
  2097. to you.
  2098.  
  2099.  Now add the note files to your project, select Update Dictionary, and you can retrieve any note 
  2100. by typing its name in any text window and pressing <Enter>. If the name of the struct consists of 
  2101. the exact topic followed by “Note” then it will be easy to remember. And if you place a comment 
  2102. in your source code containing the name of the note, such as /* see modDateNote */ ,
  2103. then all you have to do is click to the right of the note name and press <Enter>.
  2104.  
  2105. A note can be of any length, and if you edit it heavily you can probably clean up the appearance 
  2106. afterwards with Reformat Selection.
  2107.  
  2108.     When in doubt
  2109. If you’re sure that a term should be in your dictionary, but can’t retrieve any entry for it, see 
  2110. the “Lookup problems” section in the last chapter, “If there’s a problem”.
  2111.  
  2112. It’s difficult to come up with memorable names for absolutely everything, and on rare occasions 
  2113. you may find yourself trying to look up a function or struct, and not remember a darn thing about 
  2114. the name you gave it. For that matter, the names of toolbox things aren’t always stunning in their 
  2115. clarity, either. When this happens, sometimes it helps to type a guess and press <Enter>, even if 
  2116. you’re sure that you’re off by a mile. EnterAct doesn’t know that, and will retrieve the best 
  2117. matches for what you typed anyway. This “free association” may help jog your memory.
  2118. Some words, such as “Pointer”, are spelled out in full in some uses, but abbreviated in others (in 
  2119. the toolbox, you’ll find ATPreqPointer and NewPtr). If you were to  type NewPointer<Enter> for 
  2120. example, you probably wouldn’t be able to retrieve lookup for NewPtr, since the lookup function 
  2121. would count things like ATPreqPointer as being a “better” match. So, if the full spelling of a name 
  2122. doesn’t work, try abbreviating any commonly–occurring part(s) of the name. And of course, if 
  2123. you try the abbreviation first without success, try spelling the whole thing out.
  2124.  
  2125.  As an odd example, DisposeHdle<Enter> probably won’t retrieve DisposHandle, because there will 
  2126. probably be terms in your dictionary containing Dispose spelled out fully (with the “e” on the 
  2127. end), and EnterAct will score these as better matches. A run of matching characters always 
  2128. counts more than bits and pieces that match, so if you’re after an abbreviated name but spell it 
  2129. out in full you may accidentally retrieve terms that match the fully–spelled out version. Note that 
  2130. DisposeHandle<Enter> would retrieve DisposHandle, as a result of the much higher score resulting 
  2131. from spelling out Handle in full. This abbreviation versus full–spelling choice will only rarely be a 
  2132. problem, but you should keep it in the back of your mind.
  2133.     
  2134. ----------------------------------------------------------
  2135. Seeing where a term is defined
  2136. ----------------------------------------------------------
  2137.  
  2138.     <Option>double–click
  2139. To see the file in which any dictionary term is defined, hold down the <Option> key while 
  2140. double–clicking on the term. EnterAct will enter the term in the Find dialog (the equivalent of Enter 
  2141. Selection), open the file where the term is defined, and scroll to the first instance of the term in 
  2142. the file.
  2143.  
  2144. Except for functions, methods, structs, classes, unions, and enums, for which you’ll almost 
  2145. always be scrolled to the exact defining instance, with no tripping over a mention in a comment or 
  2146. variable declaration or prototype.
  2147.  
  2148. Since a double–click selects just one word, this approach doesn’t work with “full” method names 
  2149. that contain colons: the menu command Find Selection is provided for these cases, discussed also 
  2150. in the “Browsing” chapter.
  2151.  
  2152.     Find Definition
  2153. When you want to see the defining instance of a method, select the entire name on both sides of the 
  2154. two colons and then pick Find Selection. This does the same thing as <Option> double–click, but also 
  2155. works with names that consist of more than one word.
  2156.  
  2157. If a particular method name is used in several classes, EnterAct won’t know which method you 
  2158. want to see the definition of if you just <Option>double–click on the method name. To pick a 
  2159. specific method, click to the right of the method name and press <Enter>. The resulting lookup 
  2160. window will contain entries for all methods with that name: advance to the one you want by 
  2161. pressing <Enter> repeatedly. Then select the entire class name, colons, and method name and pick 
  2162. Find Definition. For an illustration, see the “Browsing” chapter.
  2163. Find Definition ignores trailing spaces or tabs, and also accepts hint characters in much the way 
  2164. that lookup does—see just below.
  2165.  
  2166.     If there are multiple definitions
  2167. <Option>double–click or Find Definition will show only a single defining instance of a term. 
  2168. However, Find Definition will accept a hint character after the term to be found, and this will at 
  2169. least limit the defining instance to one type of thing (function, typedef, define etc). For example, 
  2170. if you had both a function and a typedef named “FileStuff” then applying Find Definition to all of 
  2171. “FileStuff(” would find the defining instance of the function, whereas applying it to the selection 
  2172. “FileStuff t” would bring up the defining instance of the typedef. Hint characters are listed and 
  2173. described in “Lookup” chapter, in the “Hints for speedup” section. To make the hint work with 
  2174. Find Definition, type it after the term you want found (a space is needed if the hint is a letter), 
  2175. then select the term and the hint before issuing the Find Definition command.
  2176.  
  2177. If there are multiple definitions of a term that are of the same type (eg several functions with the 
  2178. same name) and you wish to see them, you’ll have to do a multi–file search on the term and pick 
  2179. out the defining instances yourself. When your project consists of several applications blended 
  2180. together, you can minimze multiple–definition confusion by not adding any files that you definitely 
  2181. don’t need.
  2182.     
  2183. ----------------------------------------------------------
  2184. Some thoughts on using EnterAct
  2185. ----------------------------------------------------------
  2186.  
  2187.     Projects are cheap
  2188. EnterAct projects are quick and easy to create, the only real penalty being the amount of disk 
  2189. space used. While an EnterAct project can be truly enormous and still be usable, lookup will be 
  2190. faster and more appropriate if you tailor your project to the problem at hand. As an extreme 
  2191. example, here’s a generic project that would be perfectly suitable for developing file–handling 
  2192. functions:
  2193.  
  2194. Lookup in this size project will always be instantaneous no matter how bad your spelling, and 
  2195. lookup for your terms will never be confused by accidental matches against terms in files that you 
  2196. don’t need reference to. While accidental matches are not common, the speed of lookup when your 
  2197. spelling is not exact does depend directly on the size of your dictionary.
  2198.  
  2199. The rule of thumb then is that an EnterAct project can consist of whatever files you want, but 
  2200. performance will be better if you don’t add files that you don’t need. There is a tradeoff between 
  2201. having absolutely everything of potential interest in a large, sluggish project, and having several 
  2202. smaller but better–performing projects. Performance for a given project is determined by the 
  2203. speed of your particular Macintosh, and a bit of experience should quickly provide you with a 
  2204. guide as to how ruthless to be about trimming unnecessary files. 
  2205.  
  2206. Roughly speaking, you’ll be interested in minimizing dictionary size if you have a Mac Plus, less 
  2207. so with an SE, and hardly ever if you have a Mac II or faster.
  2208.  
  2209.     Learning from or reviewing code
  2210. If your purpose is to explore rather than create, then you won’t be typing in many incorrect 
  2211. spellings. Lookup when spelling is correct is always instant, which is the case if you’re just 
  2212. reading through code and looking up terms in the code with a click–and–<Enter> or Find Definition 
  2213. for the terms as you go. In this case the only restrictions on the size of the project are the 
  2214. amount of disk space and RAM needed, and you can add absolutely all files related to the 
  2215. application without slowing down the lookup, no matter what model your Macintosh is.
  2216.  
  2217.     If lookup is too slow
  2218. As mentioned above, there is a tradeoff between having lookup for absolutely everything and 
  2219. having fast lookup. In general, the faster your Macintosh is the more you can throw into your 
  2220. dictionary. If you have a slower Macintosh, it will pay especially to add to your project only those 
  2221. toolbox headers in the “Mac #includes” folder that you really need. SANE.h, for example, is 
  2222. loaded with enum constants, constants that you’ll need access to only if you’re doing tricky 
  2223. floating–point stuff. If you take an extra minute to avoid adding files to your project that you 
  2224. don’t need you can greatly improve lookup performance, especially on a Mac Plus.
  2225.  
  2226. Supplying a “hint” when you want a term looked up can improve lookup speed, but this is in 
  2227. general a second–best solution since you have to type one or two extra characters for the lookup. 
  2228. See the “Hints for speedup” section in the “Lookup” chapter for details.
  2229.  
  2230.     Balance your files
  2231. Balancing all of your source files at the end of development will weed out any nasty errors 
  2232. involving improperly–terminated comments that THINK C’s compiler didn’t catch.
  2233. To balance a whole file at once, select an insertion point at the top of the file and then select 
  2234. Balance.
  2235.  
  2236. However, if you bring your dictionary up to date at the end of development, then all of the source 
  2237. files in your project will have automatically been checked for all detectable comment errors as a 
  2238. byproduct of dictionary–building. So, you need only check files that will be included in your THINK 
  2239. C project but are not included in your EnterAct project.
  2240.  
  2241.     If it moves, document it
  2242. EnterAct was designed with the hurried, lazy “document it when you think of it or forget it” 
  2243. programmer in mind (myself among them). I can’t abide inching through the folder maze to get at a 
  2244. file—in the old days before EnterAct, I actually found it simpler to keep most of my specification, 
  2245. design, test, and usage notes on paper. A lot of paper. No more. Now, by adding all of my 
  2246. documentation to my project, I can retrieve my notes on something quickly enough that it’s more 
  2247. convenient than leafing through paper—and more importantly for me, fast enough that I haven’t 
  2248. forgotten why I wanted to see the note by the time I dig it up!
  2249.  
  2250. It can be handy to start off the name of each document with an abbreviation describing what 
  2251. general type it is, and set up a folder in each project for each type. For example, in my 
  2252. “EnterAct” project folder there is an “EnterAct Design” folder containing the documents 
  2253. “D_general”, “D_cursors”, “D_files”, “D_options”, “D_undo”, “D_dictionary”, “D_lookup” 
  2254. etc. Starting each design document with “D_” for Design groups them together in the 
  2255. alphabetically–ordered plain text pane in my project. To scroll to the list of design documents 
  2256. within the plain text pane, I click in the rightmost pane to activate it and press <d>. 
  2257.  
  2258. Important usage notes are “disguised” as struct’s, as described in the “Lookup tips” chapter—so 
  2259. if I want to look at my note on wrestling with Quickdraw regions I type “RegionNote<Enter>” to 
  2260. see it, without having to even remember what file I put it in (this one I put in “THINK C: Mac 
  2261. Notes: _Quickdraw.Notes”—and, of course, I added all my “Mac Notes” to the project with the 
  2262. Add All In Folder command before updating the dictionary). 
  2263. For example ,
  2264.     if ((**availRgn).rgnSize > 10) /* see RegionNote */
  2265.         {
  2266.         yPos = 5;
  2267.         y = *(((int *)(*availRgn)) + yPos);
  2268.         while (y != 32767)
  2269.             {
  2270.             xPos = yPos + 1;
  2271.             ...etc
  2272. might look like Greek to me if I come back to review it, but by clicking to the right of RegionNote 
  2273. in the comment and pressing <Enter> I can view my hard–won note on regions that explains in 
  2274. detail what’s going on:
  2275. (nice picture in printed manual...)
  2276. EnterAct’s main attraction at present is the dictionary/lookup capability, but in a more general 
  2277. way EnterAct is intended to increase your ability to handle complexity when creating or 
  2278. reviewing C code by making the computer do the routine chores so that you can get on with the Big 
  2279. Picture. This version is not the final answer. I’m thinking that EnterAct version two will add some 
  2280. automatic code generation and documentation capabilities, but if you have some thoughts of your 
  2281. own on what version two might do, please drop me a line.
  2282.     
  2283. ----------------------------------------------------------
  2284. If there's a problem
  2285. ----------------------------------------------------------
  2286.  
  2287.     Out of memory
  2288. If you run out of memory while trying to do something, you’ll see an Alert saying “Out of 
  2289. memory. Please close up and try again when things are less busy.” or the equivalent. Open 
  2290. windows and Desk Accessories all take up memory that you can free by closing the window or DA. 
  2291. The project especially can take a lot of memory, since the entire dictionary associated with it is 
  2292. kept in memory. 
  2293.  
  2294. If you encounter frequent “Out of memory” messages, the least inconvenient but most expensive 
  2295. cure is to add more memory to your Macintosh. However, you can often free up a considerable 
  2296. amount of memory by removing relatively unneeded files from your project. The rough rule is 
  2297. that your project dictionary will take up in memory about one–half of the disk space used by all .c 
  2298. and .h files in the project. If you don’t need lookup for any of the terms in a .c or .h file, removing 
  2299. it from your project will free up some memory. Note that plain text files in the rightmost pane do 
  2300. not greatly affect memory used, since they are not incorporated into the dictionary.
  2301. Of course, if you’re running under MultiFinder the problem may just be that you don’t have a big 
  2302. enough partition allocated for EnterAct. To fix this, pick Get Info for EnterAct while in the 
  2303. (Multi)Finder and type in a larger “Application Memory Size”. A rough minimum is 300K plus 4/3 
  2304. times the disk space used by your project file after the dictionary has been built.
  2305.  
  2306.     Missing dictionary entries
  2307. In rare cases, an error in your source may lead to a term not being recorded in your dictionary, 
  2308. with no message. An example is
  2309.     int x        /* missing semicolon */
  2310.     long y;
  2311. for which EnterAct would record only the “y”, missing the “x”. This is the one time that 
  2312. EnterAct’s tolerance of errors can be a nuisance, but if you can remember where the term is 
  2313. defined then visual inspection should reveal the error, typically a missing semicolon or a missing 
  2314. or misspelled keyword. If you can’t remember where the term is defined, and you really want 
  2315. lookup to be available for it, then the one sure cure is to switch to THINK C and Compile or Check 
  2316. Syntax until you spot and fix the bug.
  2317.  
  2318.     Dictionary build problems
  2319. If the dictionary–builder trips over a bug in your code and you can’t spot the problem, your next 
  2320. best course of action is to switch to THINK C and compile the offending file. If you call for 
  2321. technical support and your code is not compilable, there is only a small chance that I’ll be able to 
  2322. help you, since the possibilities would be too open–ended. Look on the bright side, you’ll have to 
  2323. compile your code sooner or later anyway. 
  2324.  
  2325. EnterAct sets moderately strict standards for the part of your code that is outside of a function, 
  2326. struct, or union body. However, code that is inside of a function, struct, or union body is checked 
  2327. only for proper balance in a few key delimiters, typically {}, (), and /* */. As a result, almost 
  2328. all of your first–draft errors will be simply ignored. Some errors outside of a body can be 
  2329. compensated for, and the remainder that do trigger a complaint from the dictionary–builder will 
  2330. almost always be fairly obvious.
  2331.  
  2332. You’ll know you have a dictionary build problem if you see one of the messages below after 
  2333. selecting Update Dictionary, Update For Front File Only, or Update Dictionary From Disk. 
  2334.  
  2335. Statement too complex to deal with all at once. Any chance you could simplify?
  2336. This message should be rather rare. You would have to nest brackets more than 200 deep, or have 
  2337. more than 256 enum constants in a single enum in order to produce it. I’m not giving an example! 
  2338. The cure would be to reduce the number of brackets in your deeply–nested construction, or split a 
  2339. monstrous enum into two parts.
  2340.  
  2341. Typedef cannot have an init. One or the other has to go.
  2342.     typef int SHORT = 7;
  2343. This should prove rare. “typedef” essentially creates a new keyword, and you can no more 
  2344. initialize it than you could initialize “int” itself. Apologies for stating the obvious.
  2345.  
  2346. Illegal word or punctuation after struct or union.
  2347.     struct int myStruct {...     /* int */
  2348.     struct /myStruct {...        /* the '/' */
  2349.     struct myStruct (...}        /* wrong bracket */
  2350. Something between “struct” or “union” and the opening left brace (if any) of the body doesn’t 
  2351. belong. Or, you may have neglected to type in a name for the struct or union.
  2352.  
  2353. Illegal word or punctuation after enum.
  2354.     enum Numbers int {...        /* int */
  2355.     enum /Numbers {...            /* the '/' */
  2356.     enum Numbers {one two three}; /* missing commas */
  2357.     enum Numbers {one, two; three}; /* that first semicolon */
  2358. Includes all the sorts of errors for a “struct” or “union”, and also any error inside the body of 
  2359. the enum where the enum constants are listed. EnterAct does not record any terms inside a struct 
  2360. or union, but does record all enum constants, hence checking for an enum is more strict. Some 
  2361. errors (such as an extra comma) can be shrugged off, but most others will trigger this message.
  2362.  
  2363. #if has no matching #endif, #else, or #elif.
  2364. I’m afraid you’re on your own tracking this error down, since it could be anywhere in the file 
  2365. after the position shown. It could be due to a misspelling, such as #eles, or the necessary 
  2366. “if–ender” could be missing altogether.
  2367.  
  2368. Function(?) has no name.
  2369.     long    (int x, char *tPtr);
  2370.     So, give the poor function a name.
  2371.  
  2372. Pascal must be followed by a function.
  2373. “Pascal” or “pascal” indicates that a function passes arguments and returns a value according to 
  2374. Pascal rather than C conventions. For more on this topic, see your THINK C manual.
  2375. Couldn't find end of initialization.
  2376.     struct MyStruct {int x; long y} instance = {4, 7L;
  2377. Typically this is caused by a missing or extra '}', as in the above example. It could also be caused 
  2378. by a missing semicolon.
  2379.  
  2380. Unbalanced statement. Use the Balance command right after OK'ing this alert to diagnose the 
  2381. problem.
  2382. Since the Balance command checks all delimiters and shows you at least one end of an unbalanced 
  2383. construction, finding the typo that caused the lack of balance is usually straightforward. Selecting 
  2384. Balance a second time can be useful—after the second Balance either you’ll be shown a mismatch 
  2385. for the first delimiter or you’ll hear a beep indicating that the other end is completely missing.
  2386.  
  2387. Unbalanced or nested comment. Use the Balance command right after OK'ing this alert to diagnose 
  2388. the problem.
  2389. EnterAct’s comment checking while dictionary–building (and balancing) is even stricter than most 
  2390. compilers. For details, see the “Nested and bad comments” section in the “Balance” chapter. As 
  2391. a byproduct of dictionary–building, all source files in your project will be thoroughly checked for 
  2392. comment errors.
  2393. If the problem is due to consecutive comment starts, and you want to keep them because that’s the way
  2394. you do things, select Options from the Edit menu and uncheck the “Detect nested comment starts” check
  2395. box. This will partially disable EnterAct’s ability to trap comment problems, both when building your
  2396. dictionary and when balancing.
  2397.  
  2398. Lack of balance in parentheses (). Use the Balance command right after OK'ing this alert to 
  2399. diagnose the problem.
  2400. See above, Unbalanced statement....
  2401.  
  2402. Unbalanced single or double quotes. Use the Balance command right after OK'ing this alert to 
  2403. diagnose the problem.
  2404. See above, Unbalanced statement....
  2405.  
  2406. Unbalanced square brackets []. Use the Balance command right after OK'ing this alert to diagnose 
  2407. the problem.
  2408. See above, Unbalanced statement....
  2409.  
  2410. Left curly brace { is not preceded by struct, union, enum, =, or function definition.
  2411.     typedef stork MyStruct {int x; long y};/* stork?struct? */
  2412.     long ShouldBeFunction{int x, long y); /* '{' vs '(' */
  2413. Either the '{' should be something else, such as a '(', or a keyword just before the '{' is missing or 
  2414. badly misspelled. EnterAct can handle some typo’s, such as typdef sturct... but at some point 
  2415. (such as twerpdeaf stork) has to give up and complain.
  2416.  
  2417. Colon must signal class name, method name, or low-memory global.
  2418. Note this exludes some uses of the colon which are irrelevant for dictionary–building, such as bit 
  2419. fields and any usage inside a function body.
  2420.  
  2421. Something is wrong at or near the position shown. The error makes the statement nothing like C, 
  2422. and should be fairly obvious.
  2423. A Shakespearean sonnet will trigger this message. In general, the error lies outside of EnterAct’s 
  2424. area of competence. Check for typo’s at or near the position shown in the file. This message 
  2425. corresponds to the “Syntax error” message that compilers issue when they give up and don’t 
  2426. have a clue what’s going on.
  2427. My favourite way to generate this error is to accidentally add a junk file with a name ending in .c 
  2428. or .h to a project. Remember, Add All In Folder inhales every text file in a folder.
  2429.  
  2430. Function body was expected but not found at the position shown.
  2431. This typically results from a missing left brace '{' at the start of a function. Rarely, it can be 
  2432. caused by an excess semicolon in an “old–fashioned” style function definition, between the list of 
  2433. arguments in round brackets and the start of the function body, eg:
  2434. int myFunc(x,y)
  2435. int x;
  2436. long y;; /* extra semicolon */
  2437. {...}
  2438. The dictionary–builder counts up your arguments, and won’t allow more semicolons than you have 
  2439. arguments.
  2440.  
  2441.     Lookup problems
  2442. There is a complementary guide to solving lookup problems at the end of the “Lookup” chapter. 
  2443. The last section of the “Lookup tips” chapter might also be of help.
  2444.  
  2445. The term is in your dictionary but you can’t remember the spelling well enough to retrieve it? 
  2446. Virtually every name in your dictionary will have some distinctive part that uniquely identifies it, 
  2447. both from your point of view and EnterAct’s. However, three natural ways of misremembering 
  2448. can throw off your attempt to retrieve a definition; synonyms (ReadKeys vs GetKeys), 
  2449. abbreviations (NewPointer vs NewPtr), and reversals (FreeMem vs MemFree). These alterations 
  2450. will affect lookup if they involve the distinctive part of the name, or the name has no distinctive 
  2451. part at all, or if you also omit typing the distinctive part. The rule of thumb is that if the term you 
  2452. want lookup for consists entirely of common words used in many names you will have to be more 
  2453. accurate with your spelling to help EnterAct distinguish among the possibilities. By the way, with 
  2454. EnterAct you should find that the benefits of using long, descriptive names outweigh any 
  2455. drawbacks. The combination of lookup with Paste Selection Behind will let you work with long 
  2456. names almost as easily as with short ones in terms of total typing required, and longer names will 
  2457. be both easier for you to understand at a glance and easier for EnterAct to distinguish when 
  2458. looking for matching entries in your dictionary.
  2459.  
  2460. You know the term should be in your dictionary but even typing its exact name doesn’t retrieve 
  2461. it? This is rare, and is caused by EnterAct mishandling an error in your source code, in an 
  2462. attempt to compensate for first–draft errors without bothering you. Looking at the statement 
  2463. where the term is defined or mentioned in your source code will usually reveal a simple error 
  2464. such as a missing semicolon or a misspelled keyword. If not, switch to THINK C and compile your 
  2465. code until you’ve cleared any bugs in the statement where the term occurs.
  2466.  
  2467.     Balance problems
  2468. If lack of balance is caused by mismatched delimiters, such as '{' matched against ']', then by 
  2469. repeatedly selecting Balance you can toggle between the two mismatched delimiters.
  2470. If the unbalance is due to a missing delimiter, keep in mind that EnterAct handles comments 
  2471. properly, so the error will not be due to an extra delimiter inside a comment. For example, a 
  2472. comment such as
  2473. /*     1) load
  2474.         2) decrement
  2475.         3) store
  2476. */ 
  2477. won’t trigger an error, unless you start with an insertion point or selection that is inside the 
  2478. comment.
  2479. If you’re attempting to balance a closing delimiter and Balance has to run backwards through an 
  2480. “asm {..}” block while searching for the matching opener, you might get a spurious error due to 
  2481. something in an assembly–language comment—see the “Balance” chapter in “The asm problem” 
  2482. section for details.
  2483. If the problem is due to consecutive comment starts, and you want to keep them because that’s the way
  2484. you do things, select Options from the Edit menu and uncheck the “Detect nested comment starts” check
  2485. box. This will partially disable EnterAct’s ability to trap comment problems, both when building your
  2486. dictionary and when balancing.
  2487.  
  2488. *********END OF DISK MANUAL*************
  2489. Tech support: 1-416-595-9440